From ea21da8905e1a162c05504f93171ffe66d9ea5fa Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 13:20:02 +0200 Subject: [PATCH 01/20] Add str_replace to all path variables to replace "plugins/.paper-remapped/" with "plugins/" --- src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php | 4 ++-- src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php | 2 +- src/Analysis/Problem/Bukkit/PluginDependencyProblem.php | 2 +- src/Analysis/Problem/Bukkit/PluginLoadProblem.php | 2 +- src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php | 5 +++-- .../Problem/Bukkit/UnsupportedClassVersionProblem.php | 4 +++- src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php | 2 +- src/Analysis/Problem/Pocketmine/PluginRuntimeProblem.php | 2 +- .../Bukkit/Paper/paper-ambiguous-plugin-name-1-21-1.json | 4 ++-- 9 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php b/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php index cc43d335..7fe31eee 100644 --- a/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php +++ b/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php @@ -62,8 +62,8 @@ public static function getPatterns(): array public function setMatches(array $matches, mixed $patternKey): void { $this->pluginName = $matches[1]; - $this->firstPluginPath = $matches[2]; - $this->secondPluginPath = $matches[3]; + $this->firstPluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[2]); + $this->secondPluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[3]); $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getFirstPluginPath())); $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getSecondPluginPath())); diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index f48c20c4..852ee3b6 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -102,7 +102,7 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginPath = $matches[1]; + $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); $this->pluginName = $matches[2]; $this->dependencyPluginNames = preg_split("/, ?/", $matches[3]); diff --git a/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php b/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php index 6fd5fdce..dac26ef3 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php @@ -78,7 +78,7 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginPath = $matches[1]; + $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); $this->pluginName = $matches[2]; $this->dependencyPluginName = $matches[3] ?: $matches[4]; diff --git a/src/Analysis/Problem/Bukkit/PluginLoadProblem.php b/src/Analysis/Problem/Bukkit/PluginLoadProblem.php index 64b5a816..15dcecff 100644 --- a/src/Analysis/Problem/Bukkit/PluginLoadProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginLoadProblem.php @@ -50,7 +50,7 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginPath = $matches[1]; + $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); $this->pluginName = $matches[2]; $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); diff --git a/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php index f7ac99be..460aa4eb 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php @@ -53,13 +53,12 @@ public function setMatches(array $matches, mixed $patternKey): void { $pluginFileName = $matches[1]; // worldedit-bukkit-7.3.4-beta-01.jar $pluginName = $matches[2]; // worldedit-bukkit-7.3.4-beta-01 - $folderName = $matches[3]; // plugins + $folderName = str_replace("plugins/.paper-remapped", "plugins", $matches[3]); // plugins or plugins/.paper-remapped $this->pluginPath = $folderName . '/' . $pluginFileName; $this->pluginName = $pluginName; $this->apiVersion = $matches[4]; - $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); $this->addSolution((new ServerInstallDifferentVersionSolution())->setSoftwareVersion($this->getApiVersion())); @@ -76,8 +75,10 @@ public function setMatches(array $matches, mixed $patternKey): void public static function getPatterns(): array { return [ + // < 1.20 '/Could not load \'plugins[\/\\\](((?!\.jar).*)\.jar)\' in folder \'([^\']+)\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: Unsupported API version ([0-9]+\.[0-9]+)/', + // >= 1.20 '/Could not load plugin \'(((?!\.jar).*)\.jar)\' in folder \'([^\']+)\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: Unsupported API version ([0-9]+\.[0-9]+)/', ]; diff --git a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php index 428766c0..aef752cf 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php @@ -52,7 +52,7 @@ public function setMatches(array $matches, mixed $patternKey): void { $pluginFileName = $matches[1]; // worldedit-bukkit-7.3.4-beta-01.jar $pluginName = $matches[2]; // worldedit-bukkit-7.3.4-beta-01 - $folderName = $matches[3]; // plugins + $folderName = str_replace("plugins/.paper-remapped", "plugins", $matches[3]); // plugins or plugins/.paper-remapped $this->pluginPath = $folderName . '/' . $pluginFileName; $this->pluginName = $pluginName; @@ -73,8 +73,10 @@ public function setMatches(array $matches, mixed $patternKey): void public static function getPatterns(): array { return [ + // < 1.20 '/Could not load \'plugins[\/\\\](((?!\.jar).*)\.jar)\' in folder \'([^\']+)\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: java\.lang\.UnsupportedClassVersionError: .+ \(class file version (\d+)\.\d+\)/', + // >= 1.20 '/Could not load plugin \'(((?!\.jar).*)\.jar)\' in folder \'([^\']+)\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: java\.lang\.UnsupportedClassVersionError: .+ \(class file version (\d+)\.\d+\)/' ]; diff --git a/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php b/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php index 7d3c4f11..6c4bd81e 100644 --- a/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php +++ b/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php @@ -43,7 +43,7 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginPath = $matches[1]; + $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); $this->pluginName = $matches[2]; $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); diff --git a/src/Analysis/Problem/Pocketmine/PluginRuntimeProblem.php b/src/Analysis/Problem/Pocketmine/PluginRuntimeProblem.php index a6362568..f6337521 100644 --- a/src/Analysis/Problem/Pocketmine/PluginRuntimeProblem.php +++ b/src/Analysis/Problem/Pocketmine/PluginRuntimeProblem.php @@ -42,7 +42,7 @@ public static function getPatterns(): array */ public function setMatches(array $matches, $patternKey): void { - $this->pluginPath = $matches[1]; + $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); $this->pluginName = $matches[2]; $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); diff --git a/test/data/Vanilla/Bukkit/Paper/paper-ambiguous-plugin-name-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-ambiguous-plugin-name-1-21-1.json index a6231169..f97da324 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-ambiguous-plugin-name-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-ambiguous-plugin-name-1-21-1.json @@ -688,10 +688,10 @@ }, "solutions": [ { - "message": "Delete the file 'plugins\/.paper-remapped\/worldedit-bukkit-7.3.6.jar'." + "message": "Delete the file 'plugins\/worldedit-bukkit-7.3.6.jar'." }, { - "message": "Delete the file 'plugins\/.paper-remapped\/worldedit-bukkit-7.3.4.jar'." + "message": "Delete the file 'plugins\/worldedit-bukkit-7.3.4.jar'." } ] } From bb413577a9251fcb7e1340f2ab88ad12c68e4cee Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 13:20:55 +0200 Subject: [PATCH 02/20] Add more logs and tests for Paper 1.21.1 --- .../paper-multiple-depepdencies-1-21-1.json | 563 ++++++++++ .../paper-multiple-depepdencies-1-21-1.log | 49 + .../Paper/paper-plugin-dependency-1-21-1.json | 835 +++++++++++++++ .../Paper/paper-plugin-dependency-1-21-1.log | 74 ++ ...ugin-unsupported-class-version-1-21-1.json | 971 ++++++++++++++++++ ...lugin-unsupported-class-version-1-21-1.log | 91 ++ .../paper-unsupported-api-version-1-21-1.json | 862 ++++++++++++++++ .../paper-unsupported-api-version-1-21-1.log | 77 ++ test/tests/Logs/AutoLogsTest.php | 40 + 9 files changed, 3562 insertions(+) create mode 100644 test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json create mode 100644 test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.log create mode 100644 test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json create mode 100644 test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.log create mode 100644 test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json create mode 100644 test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.log create mode 100644 test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json create mode 100644 test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.log diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json new file mode 100644 index 00000000..1cf280ec --- /dev/null +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json @@ -0,0 +1,563 @@ +{ + "id": "paper\/server", + "name": "Paper", + "type": "Server Log", + "version": "1.21.1", + "title": "Paper 1.21.1 Server Log", + "entries": [ + { + "level": 6, + "time": null, + "prefix": "[12:47:34] [ServerMain\/INFO]:", + "lines": [ + { + "number": 1, + "content": "[12:47:34] [ServerMain\/INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.4+7-LTS; Eclipse Adoptium Temurin-21.0.4+7) on Linux 5.15.0-117-generic (amd64)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:34] [ServerMain\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[12:47:34] [ServerMain\/INFO]: [bootstrap] Loading Paper 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) for Minecraft 1.21.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:35] [ServerMain\/INFO]:", + "lines": [ + { + "number": 3, + "content": "[12:47:35] [ServerMain\/INFO]: [PluginInitializerManager] Initializing plugins..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:35] [ServerMain\/INFO]:", + "lines": [ + { + "number": 4, + "content": "[12:47:35] [ServerMain\/INFO]: [PluginInitializerManager] Initialized 1 plugin" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:35] [ServerMain\/INFO]:", + "lines": [ + { + "number": 5, + "content": "[12:47:35] [ServerMain\/INFO]: [PluginInitializerManager] Bukkit plugins (1):" + }, + { + "number": 6, + "content": " - Mclogs (2.6.3)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:39] [ServerMain\/INFO]:", + "lines": [ + { + "number": 7, + "content": "[12:47:39] [ServerMain\/INFO]: Environment: Environment[sessionHost=https:\/\/sessionserver.mojang.com, servicesHost=https:\/\/api.minecraftservices.com, name=PROD]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:40] [ServerMain\/INFO]:", + "lines": [ + { + "number": 8, + "content": "[12:47:40] [ServerMain\/INFO]: Loaded 1290 recipes" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:41] [ServerMain\/INFO]:", + "lines": [ + { + "number": 9, + "content": "[12:47:41] [ServerMain\/INFO]: Loaded 1399 advancements" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 10, + "content": "[12:47:41] [Server thread\/INFO]: Starting minecraft server version 1.21.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 11, + "content": "[12:47:41] [Server thread\/INFO]: Loading properties" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 12, + "content": "[12:47:41] [Server thread\/INFO]: This server is running Paper version 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 13, + "content": "[12:47:41] [Server thread\/INFO]: [spark] This server bundles the spark profiler. For more information please visit https:\/\/docs.papermc.io\/paper\/profiling" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 14, + "content": "[12:47:41] [Server thread\/INFO]: Server Ping Player Sample Count: 12" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 15, + "content": "[12:47:41] [Server thread\/INFO]: Using 4 threads for Netty based IO" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:42] [Server thread\/INFO]:", + "lines": [ + { + "number": 16, + "content": "[12:47:42] [Server thread\/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I\/O threads, 1 worker threads, and population gen parallelism of 1 threads" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 17, + "content": "[12:47:43] [Server thread\/INFO]: Default game type: SURVIVAL" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 18, + "content": "[12:47:43] [Server thread\/INFO]: Generating keypair" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 19, + "content": "[12:47:43] [Server thread\/INFO]: Starting Minecraft server on *:16754" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 20, + "content": "[12:47:43] [Server thread\/INFO]: Using epoll channel type" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 21, + "content": "[12:47:43] [Server thread\/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 22, + "content": "[12:47:43] [Server thread\/INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity." + } + ] + }, + { + "level": 3, + "time": null, + "prefix": "[12:47:43] [Server thread\/ERROR]:", + "lines": [ + { + "number": 23, + "content": "[12:47:43] [Server thread\/ERROR]: [ModernPluginLoadingStrategy] Could not load 'plugins\/.paper-remapped\/mclogs-bukkit-2.6.3.jar' in 'plugins\/.paper-remapped'" + }, + { + "number": 24, + "content": "org.bukkit.plugin.UnknownDependencyException: Unknown\/missing dependency plugins: [example1, example2]. Please download and install these plugins to run 'Mclogs'." + }, + { + "number": 25, + "content": "\tat io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:82) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 26, + "content": "\tat io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 27, + "content": "\tat io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 28, + "content": "\tat org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 29, + "content": "\tat net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 30, + "content": "\tat net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 31, + "content": "\tat net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 32, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) ~[?:?]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 33, + "content": "[12:47:43] [Server thread\/INFO]: Server permissions file permissions.yml is empty, ignoring it" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 34, + "content": "[12:47:43] [Server thread\/INFO]: Preparing level \"world\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 35, + "content": "[12:47:43] [Server thread\/INFO]: Preparing start region for dimension minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:44] [Server thread\/INFO]:", + "lines": [ + { + "number": 36, + "content": "[12:47:44] [Server thread\/INFO]: Time elapsed: 1191 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:44] [Server thread\/INFO]:", + "lines": [ + { + "number": 37, + "content": "[12:47:44] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_nether" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 38, + "content": "[12:47:45] [Server thread\/INFO]: Time elapsed: 144 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 39, + "content": "[12:47:45] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_end" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 40, + "content": "[12:47:45] [Server thread\/INFO]: Time elapsed: 161 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 41, + "content": "[12:47:45] [Server thread\/INFO]: [spark] Starting background profiler..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 42, + "content": "[12:47:45] [Server thread\/INFO]: Done preparing level \"world\" (2.234s)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 43, + "content": "[12:47:45] [Server thread\/INFO]: Starting GS4 status listener" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 44, + "content": "[12:47:45] [Server thread\/INFO]: Thread Query Listener started" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Query Listener #1\/INFO]:", + "lines": [ + { + "number": 45, + "content": "[12:47:45] [Query Listener #1\/INFO]: Query running on 0.0.0.0:9898" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 46, + "content": "[12:47:45] [Server thread\/INFO]: JMX monitoring enabled" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 47, + "content": "[12:47:45] [Server thread\/INFO]: Running delayed init tasks" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 48, + "content": "[12:47:45] [Server thread\/INFO]: Done (11.257s)! For help, type \"help\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[12:47:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 49, + "content": "[12:47:45] [Server thread\/INFO]: Timings Reset" + } + ] + } + ], + "analysis": { + "problems": [ + { + "message": "The plugin '.paper-remapped\/mclogs-bukkit-2.6.3' is missing the required plugins 'example1', 'example2'.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[12:47:43] [Server thread\/ERROR]:", + "lines": [ + { + "number": 23, + "content": "[12:47:43] [Server thread\/ERROR]: [ModernPluginLoadingStrategy] Could not load 'plugins\/.paper-remapped\/mclogs-bukkit-2.6.3.jar' in 'plugins\/.paper-remapped'" + }, + { + "number": 24, + "content": "org.bukkit.plugin.UnknownDependencyException: Unknown\/missing dependency plugins: [example1, example2]. Please download and install these plugins to run 'Mclogs'." + }, + { + "number": 25, + "content": "\tat io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:82) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 26, + "content": "\tat io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 27, + "content": "\tat io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 28, + "content": "\tat org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 29, + "content": "\tat net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 30, + "content": "\tat net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 31, + "content": "\tat net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 32, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) ~[?:?]" + } + ] + }, + "solutions": [ + { + "message": "Install the plugin 'example1'." + }, + { + "message": "Install the plugin 'example2'." + }, + { + "message": "Delete the file 'plugins\/mclogs-bukkit-2.6.3.jar'." + } + ] + } + ], + "information": [ + { + "message": "Minecraft version: 1.21.1", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[12:47:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 10, + "content": "[12:47:41] [Server thread\/INFO]: Starting minecraft server version 1.21.1" + } + ] + }, + "label": "Minecraft version", + "value": "1.21.1" + } + ] + } +} \ No newline at end of file diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.log b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.log new file mode 100644 index 00000000..3db2ca38 --- /dev/null +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.log @@ -0,0 +1,49 @@ +[12:47:34] [ServerMain/INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.4+7-LTS; Eclipse Adoptium Temurin-21.0.4+7) on Linux 5.15.0-117-generic (amd64) +[12:47:34] [ServerMain/INFO]: [bootstrap] Loading Paper 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) for Minecraft 1.21.1 +[12:47:35] [ServerMain/INFO]: [PluginInitializerManager] Initializing plugins... +[12:47:35] [ServerMain/INFO]: [PluginInitializerManager] Initialized 1 plugin +[12:47:35] [ServerMain/INFO]: [PluginInitializerManager] Bukkit plugins (1): + - Mclogs (2.6.3) +[12:47:39] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD] +[12:47:40] [ServerMain/INFO]: Loaded 1290 recipes +[12:47:41] [ServerMain/INFO]: Loaded 1399 advancements +[12:47:41] [Server thread/INFO]: Starting minecraft server version 1.21.1 +[12:47:41] [Server thread/INFO]: Loading properties +[12:47:41] [Server thread/INFO]: This server is running Paper version 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT) +[12:47:41] [Server thread/INFO]: [spark] This server bundles the spark profiler. For more information please visit https://docs.papermc.io/paper/profiling +[12:47:41] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[12:47:41] [Server thread/INFO]: Using 4 threads for Netty based IO +[12:47:42] [Server thread/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I/O threads, 1 worker threads, and population gen parallelism of 1 threads +[12:47:43] [Server thread/INFO]: Default game type: SURVIVAL +[12:47:43] [Server thread/INFO]: Generating keypair +[12:47:43] [Server thread/INFO]: Starting Minecraft server on *:16754 +[12:47:43] [Server thread/INFO]: Using epoll channel type +[12:47:43] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[12:47:43] [Server thread/INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity. +[12:47:43] [Server thread/ERROR]: [ModernPluginLoadingStrategy] Could not load 'plugins/.paper-remapped/mclogs-bukkit-2.6.3.jar' in 'plugins/.paper-remapped' +org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [example1, example2]. Please download and install these plugins to run 'Mclogs'. + at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:82) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] +[12:47:43] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[12:47:43] [Server thread/INFO]: Preparing level "world" +[12:47:43] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[12:47:44] [Server thread/INFO]: Time elapsed: 1191 ms +[12:47:44] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether +[12:47:45] [Server thread/INFO]: Time elapsed: 144 ms +[12:47:45] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end +[12:47:45] [Server thread/INFO]: Time elapsed: 161 ms +[12:47:45] [Server thread/INFO]: [spark] Starting background profiler... +[12:47:45] [Server thread/INFO]: Done preparing level "world" (2.234s) +[12:47:45] [Server thread/INFO]: Starting GS4 status listener +[12:47:45] [Server thread/INFO]: Thread Query Listener started +[12:47:45] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[12:47:45] [Server thread/INFO]: JMX monitoring enabled +[12:47:45] [Server thread/INFO]: Running delayed init tasks +[12:47:45] [Server thread/INFO]: Done (11.257s)! For help, type "help" +[12:47:45] [Server thread/INFO]: Timings Reset \ No newline at end of file diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json new file mode 100644 index 00000000..42eb0334 --- /dev/null +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json @@ -0,0 +1,835 @@ +{ + "id": "paper\/server", + "name": "Paper", + "type": "Server Log", + "version": "1.21.1", + "title": "Paper 1.21.1 Server Log", + "entries": [ + { + "level": 6, + "time": null, + "prefix": "[19:03:01] [ServerMain\/INFO]:", + "lines": [ + { + "number": 1, + "content": "[19:03:01] [ServerMain\/INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS; Eclipse Adoptium Temurin-21.0.3+9) on Linux 5.15.0-117-generic (amd64)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:01] [ServerMain\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[19:03:01] [ServerMain\/INFO]: [bootstrap] Loading Paper 1.21.1-115-master@ba3c29b (2024-09-30T02:19:06Z) for Minecraft 1.21.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:01] [ServerMain\/INFO]:", + "lines": [ + { + "number": 3, + "content": "[19:03:01] [ServerMain\/INFO]: [PluginInitializerManager] Initializing plugins..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:01] [Paper Plugin Remapper Thread - 2\/INFO]:", + "lines": [ + { + "number": 4, + "content": "[19:03:01] [Paper Plugin Remapper Thread - 2\/INFO]: [PluginRemapper] Remapping plugin 'plugins\/worldguard-bukkit-7.0.12-dist.jar'..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:02] [Paper Plugin Remapper Thread - 2\/INFO]:", + "lines": [ + { + "number": 5, + "content": "[19:03:02] [Paper Plugin Remapper Thread - 2\/INFO]: [PluginRemapper] Done remapping plugin 'plugins\/worldguard-bukkit-7.0.12-dist.jar' in 1581ms." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:03] [ServerMain\/INFO]:", + "lines": [ + { + "number": 6, + "content": "[19:03:03] [ServerMain\/INFO]: [PluginInitializerManager] Initialized 1 plugin" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:03] [ServerMain\/INFO]:", + "lines": [ + { + "number": 7, + "content": "[19:03:03] [ServerMain\/INFO]: [PluginInitializerManager] Bukkit plugins (1):" + }, + { + "number": 8, + "content": " - WorldGuard (7.0.12+829a4a4)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:07] [ServerMain\/INFO]:", + "lines": [ + { + "number": 9, + "content": "[19:03:07] [ServerMain\/INFO]: Environment: Environment[sessionHost=https:\/\/sessionserver.mojang.com, servicesHost=https:\/\/api.minecraftservices.com, name=PROD]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:08] [ServerMain\/INFO]:", + "lines": [ + { + "number": 10, + "content": "[19:03:08] [ServerMain\/INFO]: Loaded 1290 recipes" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:09] [ServerMain\/INFO]:", + "lines": [ + { + "number": 11, + "content": "[19:03:09] [ServerMain\/INFO]: Loaded 1399 advancements" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:09] [Server thread\/INFO]:", + "lines": [ + { + "number": 12, + "content": "[19:03:09] [Server thread\/INFO]: Starting minecraft server version 1.21.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:09] [Server thread\/INFO]:", + "lines": [ + { + "number": 13, + "content": "[19:03:09] [Server thread\/INFO]: Loading properties" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:09] [Server thread\/INFO]:", + "lines": [ + { + "number": 14, + "content": "[19:03:09] [Server thread\/INFO]: This server is running Paper version 1.21.1-115-master@ba3c29b (2024-09-30T02:19:06Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:10] [Server thread\/INFO]:", + "lines": [ + { + "number": 15, + "content": "[19:03:10] [Server thread\/INFO]: [spark] This server bundles the spark profiler. For more information please visit https:\/\/docs.papermc.io\/paper\/profiling" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:10] [Server thread\/INFO]:", + "lines": [ + { + "number": 16, + "content": "[19:03:10] [Server thread\/INFO]: Server Ping Player Sample Count: 12" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:10] [Server thread\/INFO]:", + "lines": [ + { + "number": 17, + "content": "[19:03:10] [Server thread\/INFO]: Using 4 threads for Netty based IO" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 18, + "content": "[19:03:11] [Server thread\/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I\/O threads, 1 worker threads, and population gen parallelism of 1 threads" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 19, + "content": "[19:03:11] [Server thread\/INFO]: Default game type: SURVIVAL" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 20, + "content": "[19:03:11] [Server thread\/INFO]: Generating keypair" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 21, + "content": "[19:03:11] [Server thread\/INFO]: Starting Minecraft server on *:16754" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 22, + "content": "[19:03:11] [Server thread\/INFO]: Using epoll channel type" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 23, + "content": "[19:03:11] [Server thread\/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 24, + "content": "[19:03:11] [Server thread\/INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity." + } + ] + }, + { + "level": 3, + "time": null, + "prefix": "[19:03:11] [Server thread\/ERROR]:", + "lines": [ + { + "number": 25, + "content": "[19:03:11] [Server thread\/ERROR]: [ModernPluginLoadingStrategy] Could not load 'plugins\/.paper-remapped\/worldguard-bukkit-7.0.12-dist.jar' in 'plugins\/.paper-remapped'" + }, + { + "number": 26, + "content": "org.bukkit.plugin.UnknownDependencyException: Unknown\/missing dependency plugins: [WorldEdit]. Please download and install these plugins to run 'WorldGuard'." + }, + { + "number": 27, + "content": "\tat io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:82) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 28, + "content": "\tat io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 29, + "content": "\tat io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 30, + "content": "\tat org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 31, + "content": "\tat net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 32, + "content": "\tat net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 33, + "content": "\tat net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 34, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) ~[?:?]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 35, + "content": "[19:03:11] [Server thread\/INFO]: Server permissions file permissions.yml is empty, ignoring it" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 36, + "content": "[19:03:11] [Server thread\/INFO]: Preparing level \"world\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 37, + "content": "[19:03:12] [Server thread\/INFO]: Preparing start region for dimension minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:13] [Server thread\/INFO]:", + "lines": [ + { + "number": 38, + "content": "[19:03:13] [Server thread\/INFO]: Time elapsed: 875 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:13] [Server thread\/INFO]:", + "lines": [ + { + "number": 39, + "content": "[19:03:13] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_nether" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 40, + "content": "[19:03:14] [Server thread\/INFO]: Time elapsed: 947 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 41, + "content": "[19:03:14] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_end" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 42, + "content": "[19:03:14] [Server thread\/INFO]: Time elapsed: 159 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 43, + "content": "[19:03:14] [Server thread\/INFO]: [spark] Starting background profiler..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 44, + "content": "[19:03:14] [Server thread\/INFO]: Done preparing level \"world\" (2.869s)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 45, + "content": "[19:03:14] [Server thread\/INFO]: Starting GS4 status listener" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 46, + "content": "[19:03:14] [Server thread\/INFO]: Thread Query Listener started" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Query Listener #1\/INFO]:", + "lines": [ + { + "number": 47, + "content": "[19:03:14] [Query Listener #1\/INFO]: Query running on 0.0.0.0:9898" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 48, + "content": "[19:03:14] [Server thread\/INFO]: JMX monitoring enabled" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 49, + "content": "[19:03:14] [Server thread\/INFO]: Running delayed init tasks" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 50, + "content": "[19:03:14] [Server thread\/INFO]: Done (14.448s)! For help, type \"help\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:03:14] [Server thread\/INFO]:", + "lines": [ + { + "number": 51, + "content": "[19:03:14] [Server thread\/INFO]: Timings Reset" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 52, + "content": "[19:13:19] [Server thread\/INFO]: Stopping the server" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 53, + "content": "[19:13:19] [Server thread\/INFO]: Stopping server" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 54, + "content": "[19:13:19] [Server thread\/INFO]: Saving players" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 55, + "content": "[19:13:19] [Server thread\/INFO]: Saving worlds" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 56, + "content": "[19:13:19] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world]'\/minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 57, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 58, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 59, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 60, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Saved 0 block chunks, 0 entity chunks, 0 poi chunks in world 'world' in 0.00s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 61, + "content": "[19:13:19] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world_nether]'\/minecraft:the_nether" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 62, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 63, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 64, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 65, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Saved 0 block chunks, 1 entity chunks, 0 poi chunks in world 'world_nether' in 0.00s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 66, + "content": "[19:13:19] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'\/minecraft:the_end" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 67, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 68, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 69, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 70, + "content": "[19:13:19] [Server thread\/INFO]: [ChunkHolderManager] Saved 0 block chunks, 10 entity chunks, 0 poi chunks in world 'world_the_end' in 0.01s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 71, + "content": "[19:13:19] [Server thread\/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 72, + "content": "[19:13:19] [Server thread\/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 73, + "content": "[19:13:19] [Server thread\/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[19:13:19] [Server thread\/INFO]:", + "lines": [ + { + "number": 74, + "content": "[19:13:19] [Server thread\/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved" + } + ] + } + ], + "analysis": { + "problems": [ + { + "message": "The plugin '.paper-remapped\/worldguard-bukkit-7.0.12-dist' is missing the required plugin 'WorldEdit'.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[19:03:11] [Server thread\/ERROR]:", + "lines": [ + { + "number": 25, + "content": "[19:03:11] [Server thread\/ERROR]: [ModernPluginLoadingStrategy] Could not load 'plugins\/.paper-remapped\/worldguard-bukkit-7.0.12-dist.jar' in 'plugins\/.paper-remapped'" + }, + { + "number": 26, + "content": "org.bukkit.plugin.UnknownDependencyException: Unknown\/missing dependency plugins: [WorldEdit]. Please download and install these plugins to run 'WorldGuard'." + }, + { + "number": 27, + "content": "\tat io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:82) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 28, + "content": "\tat io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 29, + "content": "\tat io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 30, + "content": "\tat org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 31, + "content": "\tat net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 32, + "content": "\tat net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 33, + "content": "\tat net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b]" + }, + { + "number": 34, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) ~[?:?]" + } + ] + }, + "solutions": [ + { + "message": "Install the plugin 'WorldEdit'." + }, + { + "message": "Delete the file 'plugins\/worldguard-bukkit-7.0.12-dist.jar'." + } + ] + } + ], + "information": [ + { + "message": "Minecraft version: 1.21.1", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[19:03:09] [Server thread\/INFO]:", + "lines": [ + { + "number": 12, + "content": "[19:03:09] [Server thread\/INFO]: Starting minecraft server version 1.21.1" + } + ] + }, + "label": "Minecraft version", + "value": "1.21.1" + } + ] + } +} \ No newline at end of file diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.log b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.log new file mode 100644 index 00000000..c5b3614b --- /dev/null +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.log @@ -0,0 +1,74 @@ +[19:03:01] [ServerMain/INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS; Eclipse Adoptium Temurin-21.0.3+9) on Linux 5.15.0-117-generic (amd64) +[19:03:01] [ServerMain/INFO]: [bootstrap] Loading Paper 1.21.1-115-master@ba3c29b (2024-09-30T02:19:06Z) for Minecraft 1.21.1 +[19:03:01] [ServerMain/INFO]: [PluginInitializerManager] Initializing plugins... +[19:03:01] [Paper Plugin Remapper Thread - 2/INFO]: [PluginRemapper] Remapping plugin 'plugins/worldguard-bukkit-7.0.12-dist.jar'... +[19:03:02] [Paper Plugin Remapper Thread - 2/INFO]: [PluginRemapper] Done remapping plugin 'plugins/worldguard-bukkit-7.0.12-dist.jar' in 1581ms. +[19:03:03] [ServerMain/INFO]: [PluginInitializerManager] Initialized 1 plugin +[19:03:03] [ServerMain/INFO]: [PluginInitializerManager] Bukkit plugins (1): + - WorldGuard (7.0.12+829a4a4) +[19:03:07] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD] +[19:03:08] [ServerMain/INFO]: Loaded 1290 recipes +[19:03:09] [ServerMain/INFO]: Loaded 1399 advancements +[19:03:09] [Server thread/INFO]: Starting minecraft server version 1.21.1 +[19:03:09] [Server thread/INFO]: Loading properties +[19:03:09] [Server thread/INFO]: This server is running Paper version 1.21.1-115-master@ba3c29b (2024-09-30T02:19:06Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT) +[19:03:10] [Server thread/INFO]: [spark] This server bundles the spark profiler. For more information please visit https://docs.papermc.io/paper/profiling +[19:03:10] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[19:03:10] [Server thread/INFO]: Using 4 threads for Netty based IO +[19:03:11] [Server thread/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I/O threads, 1 worker threads, and population gen parallelism of 1 threads +[19:03:11] [Server thread/INFO]: Default game type: SURVIVAL +[19:03:11] [Server thread/INFO]: Generating keypair +[19:03:11] [Server thread/INFO]: Starting Minecraft server on *:16754 +[19:03:11] [Server thread/INFO]: Using epoll channel type +[19:03:11] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[19:03:11] [Server thread/INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity. +[19:03:11] [Server thread/ERROR]: [ModernPluginLoadingStrategy] Could not load 'plugins/.paper-remapped/worldguard-bukkit-7.0.12-dist.jar' in 'plugins/.paper-remapped' +org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [WorldEdit]. Please download and install these plugins to run 'WorldGuard'. + at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:82) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b] + at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b] + at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b] + at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-115-ba3c29b] + at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] +[19:03:11] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[19:03:11] [Server thread/INFO]: Preparing level "world" +[19:03:12] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[19:03:13] [Server thread/INFO]: Time elapsed: 875 ms +[19:03:13] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether +[19:03:14] [Server thread/INFO]: Time elapsed: 947 ms +[19:03:14] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end +[19:03:14] [Server thread/INFO]: Time elapsed: 159 ms +[19:03:14] [Server thread/INFO]: [spark] Starting background profiler... +[19:03:14] [Server thread/INFO]: Done preparing level "world" (2.869s) +[19:03:14] [Server thread/INFO]: Starting GS4 status listener +[19:03:14] [Server thread/INFO]: Thread Query Listener started +[19:03:14] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[19:03:14] [Server thread/INFO]: JMX monitoring enabled +[19:03:14] [Server thread/INFO]: Running delayed init tasks +[19:03:14] [Server thread/INFO]: Done (14.448s)! For help, type "help" +[19:03:14] [Server thread/INFO]: Timings Reset +[19:13:19] [Server thread/INFO]: Stopping the server +[19:13:19] [Server thread/INFO]: Stopping server +[19:13:19] [Server thread/INFO]: Saving players +[19:13:19] [Server thread/INFO]: Saving worlds +[19:13:19] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world' +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world' +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world' +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Saved 0 block chunks, 0 entity chunks, 0 poi chunks in world 'world' in 0.00s +[19:13:19] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether' +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether' +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether' +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Saved 0 block chunks, 1 entity chunks, 0 poi chunks in world 'world_nether' in 0.00s +[19:13:19] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end' +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end' +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end' +[19:13:19] [Server thread/INFO]: [ChunkHolderManager] Saved 0 block chunks, 10 entity chunks, 0 poi chunks in world 'world_the_end' in 0.01s +[19:13:19] [Server thread/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved +[19:13:19] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved +[19:13:19] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved +[19:13:19] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved \ No newline at end of file diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json new file mode 100644 index 00000000..a10af4d9 --- /dev/null +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json @@ -0,0 +1,971 @@ +{ + "id": "paper\/server", + "name": "Paper", + "type": "Server Log", + "version": "1.21.1", + "title": "Paper 1.21.1 Server Log", + "entries": [ + { + "level": 6, + "time": null, + "prefix": "[13:02:51] [ServerMain\/INFO]:", + "lines": [ + { + "number": 1, + "content": "[13:02:51] [ServerMain\/INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS; Eclipse Adoptium Temurin-21.0.3+9) on Linux 5.15.0-117-generic (amd64)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:51] [ServerMain\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[13:02:51] [ServerMain\/INFO]: [bootstrap] Loading Paper 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) for Minecraft 1.21.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:52] [ServerMain\/INFO]:", + "lines": [ + { + "number": 3, + "content": "[13:02:52] [ServerMain\/INFO]: [PluginInitializerManager] Initializing plugins..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:52] [Paper Plugin Remapper Thread - 2\/INFO]:", + "lines": [ + { + "number": 4, + "content": "[13:02:52] [Paper Plugin Remapper Thread - 2\/INFO]: [PluginRemapper] Remapping plugin 'plugins\/mclogs-bukkit-dev.jar'..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:53] [Paper Plugin Remapper Thread - 2\/INFO]:", + "lines": [ + { + "number": 5, + "content": "[13:02:53] [Paper Plugin Remapper Thread - 2\/INFO]: [PluginRemapper] Done remapping plugin 'plugins\/mclogs-bukkit-dev.jar' in 1015ms." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:53] [ServerMain\/INFO]:", + "lines": [ + { + "number": 6, + "content": "[13:02:53] [ServerMain\/INFO]: [PluginInitializerManager] Initialized 1 plugin" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:53] [ServerMain\/INFO]:", + "lines": [ + { + "number": 7, + "content": "[13:02:53] [ServerMain\/INFO]: [PluginInitializerManager] Bukkit plugins (1):" + }, + { + "number": 8, + "content": " - Mclogs (dev)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:57] [ServerMain\/INFO]:", + "lines": [ + { + "number": 9, + "content": "[13:02:57] [ServerMain\/INFO]: Environment: Environment[sessionHost=https:\/\/sessionserver.mojang.com, servicesHost=https:\/\/api.minecraftservices.com, name=PROD]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:58] [ServerMain\/INFO]:", + "lines": [ + { + "number": 10, + "content": "[13:02:58] [ServerMain\/INFO]: Loaded 1290 recipes" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:58] [ServerMain\/INFO]:", + "lines": [ + { + "number": 11, + "content": "[13:02:58] [ServerMain\/INFO]: Loaded 1399 advancements" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 12, + "content": "[13:02:59] [Server thread\/INFO]: Starting minecraft server version 1.21.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 13, + "content": "[13:02:59] [Server thread\/INFO]: Loading properties" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 14, + "content": "[13:02:59] [Server thread\/INFO]: This server is running Paper version 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 15, + "content": "[13:02:59] [Server thread\/INFO]: [spark] This server bundles the spark profiler. For more information please visit https:\/\/docs.papermc.io\/paper\/profiling" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 16, + "content": "[13:02:59] [Server thread\/INFO]: Server Ping Player Sample Count: 12" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:02:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 17, + "content": "[13:02:59] [Server thread\/INFO]: Using 4 threads for Netty based IO" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:00] [Server thread\/INFO]:", + "lines": [ + { + "number": 18, + "content": "[13:03:00] [Server thread\/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I\/O threads, 1 worker threads, and population gen parallelism of 1 threads" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 19, + "content": "[13:03:01] [Server thread\/INFO]: Default game type: SURVIVAL" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 20, + "content": "[13:03:01] [Server thread\/INFO]: Generating keypair" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 21, + "content": "[13:03:01] [Server thread\/INFO]: Starting Minecraft server on *:16754" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 22, + "content": "[13:03:01] [Server thread\/INFO]: Using epoll channel type" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 23, + "content": "[13:03:01] [Server thread\/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 24, + "content": "[13:03:01] [Server thread\/INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity." + } + ] + }, + { + "level": 3, + "time": null, + "prefix": "[13:03:01] [Server thread\/ERROR]:", + "lines": [ + { + "number": 25, + "content": "[13:03:01] [Server thread\/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'mclogs-bukkit-dev.jar' in folder 'plugins\/.paper-remapped'" + }, + { + "number": 26, + "content": "org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: gs\/mclo\/bukkit\/MclogsPlugin has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 65.0" + }, + { + "number": 27, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:129) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 28, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 29, + "content": "\tat io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 30, + "content": "\tat io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 31, + "content": "\tat io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 32, + "content": "\tat org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 33, + "content": "\tat net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 34, + "content": "\tat net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 35, + "content": "\tat net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 36, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) ~[?:?]" + }, + { + "number": 37, + "content": "Caused by: java.lang.UnsupportedClassVersionError: gs\/mclo\/bukkit\/MclogsPlugin has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 65.0" + }, + { + "number": 38, + "content": "\tat java.base\/java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]" + }, + { + "number": 39, + "content": "\tat java.base\/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) ~[?:?]" + }, + { + "number": 40, + "content": "\tat java.base\/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?]" + }, + { + "number": 41, + "content": "\tat org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:243) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]" + }, + { + "number": 42, + "content": "\tat java.base\/java.lang.ClassLoader.loadClass(ClassLoader.java:593) ~[?:?]" + }, + { + "number": 43, + "content": "\tat org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:169) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]" + }, + { + "number": 44, + "content": "\tat org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]" + }, + { + "number": 45, + "content": "\tat java.base\/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]" + }, + { + "number": 46, + "content": "\tat java.base\/java.lang.Class.forName0(Native Method) ~[?:?]" + }, + { + "number": 47, + "content": "\tat java.base\/java.lang.Class.forName(Class.java:534) ~[?:?]" + }, + { + "number": 48, + "content": "\tat java.base\/java.lang.Class.forName(Class.java:513) ~[?:?]" + }, + { + "number": 49, + "content": "\tat org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]" + }, + { + "number": 50, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:125) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 51, + "content": "\t... 9 more" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 52, + "content": "[13:03:01] [Server thread\/INFO]: Server permissions file permissions.yml is empty, ignoring it" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 53, + "content": "[13:03:01] [Server thread\/INFO]: Preparing level \"world\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:02] [Server thread\/INFO]:", + "lines": [ + { + "number": 54, + "content": "[13:03:02] [Server thread\/INFO]: Preparing start region for dimension minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:03] [Server thread\/INFO]:", + "lines": [ + { + "number": 55, + "content": "[13:03:03] [Server thread\/INFO]: Time elapsed: 1387 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:03] [Server thread\/INFO]:", + "lines": [ + { + "number": 56, + "content": "[13:03:03] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_nether" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:03] [Server thread\/INFO]:", + "lines": [ + { + "number": 57, + "content": "[13:03:03] [Server thread\/INFO]: Time elapsed: 155 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:03] [Server thread\/INFO]:", + "lines": [ + { + "number": 58, + "content": "[13:03:03] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_end" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:03] [Server thread\/INFO]:", + "lines": [ + { + "number": 59, + "content": "[13:03:03] [Server thread\/INFO]: Time elapsed: 200 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:03] [Server thread\/INFO]:", + "lines": [ + { + "number": 60, + "content": "[13:03:03] [Server thread\/INFO]: [spark] Starting background profiler..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:04] [Server thread\/INFO]:", + "lines": [ + { + "number": 61, + "content": "[13:03:04] [Server thread\/INFO]: Done preparing level \"world\" (2.650s)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:04] [Server thread\/INFO]:", + "lines": [ + { + "number": 62, + "content": "[13:03:04] [Server thread\/INFO]: Starting GS4 status listener" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:04] [Server thread\/INFO]:", + "lines": [ + { + "number": 63, + "content": "[13:03:04] [Server thread\/INFO]: Thread Query Listener started" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:04] [Query Listener #1\/INFO]:", + "lines": [ + { + "number": 64, + "content": "[13:03:04] [Query Listener #1\/INFO]: Query running on 0.0.0.0:9898" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:04] [Server thread\/INFO]:", + "lines": [ + { + "number": 65, + "content": "[13:03:04] [Server thread\/INFO]: JMX monitoring enabled" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:04] [Server thread\/INFO]:", + "lines": [ + { + "number": 66, + "content": "[13:03:04] [Server thread\/INFO]: Running delayed init tasks" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:04] [Server thread\/INFO]:", + "lines": [ + { + "number": 67, + "content": "[13:03:04] [Server thread\/INFO]: Done (12.908s)! For help, type \"help\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:04] [Server thread\/INFO]:", + "lines": [ + { + "number": 68, + "content": "[13:03:04] [Server thread\/INFO]: Timings Reset" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 69, + "content": "[13:03:21] [Server thread\/INFO]: Stopping the server" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 70, + "content": "[13:03:21] [Server thread\/INFO]: Stopping server" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 71, + "content": "[13:03:21] [Server thread\/INFO]: Saving players" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 72, + "content": "[13:03:21] [Server thread\/INFO]: Saving worlds" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 73, + "content": "[13:03:21] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world]'\/minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 74, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 75, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 76, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 77, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world' in 0.35s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 78, + "content": "[13:03:21] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world_nether]'\/minecraft:the_nether" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 79, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 80, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 81, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 82, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_nether' in 0.08s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 83, + "content": "[13:03:21] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'\/minecraft:the_end" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 84, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 85, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 86, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 87, + "content": "[13:03:21] [Server thread\/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_the_end' in 0.03s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 88, + "content": "[13:03:21] [Server thread\/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 89, + "content": "[13:03:21] [Server thread\/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 90, + "content": "[13:03:21] [Server thread\/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:03:21] [Server thread\/INFO]:", + "lines": [ + { + "number": 91, + "content": "[13:03:21] [Server thread\/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved" + } + ] + } + ], + "analysis": { + "problems": [ + { + "message": "The plugin 'mclogs-bukkit-dev' requires Java version 22 or later to run.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[13:03:01] [Server thread\/ERROR]:", + "lines": [ + { + "number": 25, + "content": "[13:03:01] [Server thread\/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'mclogs-bukkit-dev.jar' in folder 'plugins\/.paper-remapped'" + }, + { + "number": 26, + "content": "org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: gs\/mclo\/bukkit\/MclogsPlugin has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 65.0" + }, + { + "number": 27, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:129) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 28, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 29, + "content": "\tat io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 30, + "content": "\tat io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 31, + "content": "\tat io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 32, + "content": "\tat org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 33, + "content": "\tat net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 34, + "content": "\tat net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 35, + "content": "\tat net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 36, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) ~[?:?]" + }, + { + "number": 37, + "content": "Caused by: java.lang.UnsupportedClassVersionError: gs\/mclo\/bukkit\/MclogsPlugin has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 65.0" + }, + { + "number": 38, + "content": "\tat java.base\/java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]" + }, + { + "number": 39, + "content": "\tat java.base\/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) ~[?:?]" + }, + { + "number": 40, + "content": "\tat java.base\/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?]" + }, + { + "number": 41, + "content": "\tat org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:243) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]" + }, + { + "number": 42, + "content": "\tat java.base\/java.lang.ClassLoader.loadClass(ClassLoader.java:593) ~[?:?]" + }, + { + "number": 43, + "content": "\tat org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:169) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]" + }, + { + "number": 44, + "content": "\tat org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]" + }, + { + "number": 45, + "content": "\tat java.base\/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]" + }, + { + "number": 46, + "content": "\tat java.base\/java.lang.Class.forName0(Native Method) ~[?:?]" + }, + { + "number": 47, + "content": "\tat java.base\/java.lang.Class.forName(Class.java:534) ~[?:?]" + }, + { + "number": 48, + "content": "\tat java.base\/java.lang.Class.forName(Class.java:513) ~[?:?]" + }, + { + "number": 49, + "content": "\tat org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]" + }, + { + "number": 50, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:125) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 51, + "content": "\t... 9 more" + } + ] + }, + "solutions": [ + { + "message": "Delete the file 'plugins\/mclogs-bukkit-dev.jar'." + }, + { + "message": "Change your Java version to 22 or later." + } + ] + } + ], + "information": [ + { + "message": "Minecraft version: 1.21.1", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[13:02:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 12, + "content": "[13:02:59] [Server thread\/INFO]: Starting minecraft server version 1.21.1" + } + ] + }, + "label": "Minecraft version", + "value": "1.21.1" + } + ] + } +} \ No newline at end of file diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.log b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.log new file mode 100644 index 00000000..f2801957 --- /dev/null +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.log @@ -0,0 +1,91 @@ +[13:02:51] [ServerMain/INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS; Eclipse Adoptium Temurin-21.0.3+9) on Linux 5.15.0-117-generic (amd64) +[13:02:51] [ServerMain/INFO]: [bootstrap] Loading Paper 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) for Minecraft 1.21.1 +[13:02:52] [ServerMain/INFO]: [PluginInitializerManager] Initializing plugins... +[13:02:52] [Paper Plugin Remapper Thread - 2/INFO]: [PluginRemapper] Remapping plugin 'plugins/mclogs-bukkit-dev.jar'... +[13:02:53] [Paper Plugin Remapper Thread - 2/INFO]: [PluginRemapper] Done remapping plugin 'plugins/mclogs-bukkit-dev.jar' in 1015ms. +[13:02:53] [ServerMain/INFO]: [PluginInitializerManager] Initialized 1 plugin +[13:02:53] [ServerMain/INFO]: [PluginInitializerManager] Bukkit plugins (1): + - Mclogs (dev) +[13:02:57] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD] +[13:02:58] [ServerMain/INFO]: Loaded 1290 recipes +[13:02:58] [ServerMain/INFO]: Loaded 1399 advancements +[13:02:59] [Server thread/INFO]: Starting minecraft server version 1.21.1 +[13:02:59] [Server thread/INFO]: Loading properties +[13:02:59] [Server thread/INFO]: This server is running Paper version 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT) +[13:02:59] [Server thread/INFO]: [spark] This server bundles the spark profiler. For more information please visit https://docs.papermc.io/paper/profiling +[13:02:59] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[13:02:59] [Server thread/INFO]: Using 4 threads for Netty based IO +[13:03:00] [Server thread/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I/O threads, 1 worker threads, and population gen parallelism of 1 threads +[13:03:01] [Server thread/INFO]: Default game type: SURVIVAL +[13:03:01] [Server thread/INFO]: Generating keypair +[13:03:01] [Server thread/INFO]: Starting Minecraft server on *:16754 +[13:03:01] [Server thread/INFO]: Using epoll channel type +[13:03:01] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[13:03:01] [Server thread/INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity. +[13:03:01] [Server thread/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'mclogs-bukkit-dev.jar' in folder 'plugins/.paper-remapped' +org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: gs/mclo/bukkit/MclogsPlugin has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 65.0 + at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:129) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] +Caused by: java.lang.UnsupportedClassVersionError: gs/mclo/bukkit/MclogsPlugin has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 65.0 + at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[?:?] + at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) ~[?:?] + at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?] + at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:243) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?] + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593) ~[?:?] + at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:169) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?] + at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?] + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?] + at java.base/java.lang.Class.forName0(Native Method) ~[?:?] + at java.base/java.lang.Class.forName(Class.java:534) ~[?:?] + at java.base/java.lang.Class.forName(Class.java:513) ~[?:?] + at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?] + at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:125) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + ... 9 more +[13:03:01] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[13:03:01] [Server thread/INFO]: Preparing level "world" +[13:03:02] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[13:03:03] [Server thread/INFO]: Time elapsed: 1387 ms +[13:03:03] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether +[13:03:03] [Server thread/INFO]: Time elapsed: 155 ms +[13:03:03] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end +[13:03:03] [Server thread/INFO]: Time elapsed: 200 ms +[13:03:03] [Server thread/INFO]: [spark] Starting background profiler... +[13:03:04] [Server thread/INFO]: Done preparing level "world" (2.650s) +[13:03:04] [Server thread/INFO]: Starting GS4 status listener +[13:03:04] [Server thread/INFO]: Thread Query Listener started +[13:03:04] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[13:03:04] [Server thread/INFO]: JMX monitoring enabled +[13:03:04] [Server thread/INFO]: Running delayed init tasks +[13:03:04] [Server thread/INFO]: Done (12.908s)! For help, type "help" +[13:03:04] [Server thread/INFO]: Timings Reset +[13:03:21] [Server thread/INFO]: Stopping the server +[13:03:21] [Server thread/INFO]: Stopping server +[13:03:21] [Server thread/INFO]: Saving players +[13:03:21] [Server thread/INFO]: Saving worlds +[13:03:21] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world' +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world' +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world' +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world' in 0.35s +[13:03:21] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether' +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether' +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether' +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_nether' in 0.08s +[13:03:21] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end' +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end' +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end' +[13:03:21] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_the_end' in 0.03s +[13:03:21] [Server thread/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved +[13:03:21] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved +[13:03:21] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved +[13:03:21] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved \ No newline at end of file diff --git a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json new file mode 100644 index 00000000..7191ba46 --- /dev/null +++ b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json @@ -0,0 +1,862 @@ +{ + "id": "paper\/server", + "name": "Paper", + "type": "Server Log", + "version": "1.21.1", + "title": "Paper 1.21.1 Server Log", + "entries": [ + { + "level": 6, + "time": null, + "prefix": "[13:16:33] [ServerMain\/INFO]:", + "lines": [ + { + "number": 1, + "content": "[13:16:33] [ServerMain\/INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS; Eclipse Adoptium Temurin-21.0.3+9) on Linux 5.15.0-117-generic (amd64)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:33] [ServerMain\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[13:16:33] [ServerMain\/INFO]: [bootstrap] Loading Paper 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) for Minecraft 1.21.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:34] [ServerMain\/INFO]:", + "lines": [ + { + "number": 3, + "content": "[13:16:34] [ServerMain\/INFO]: [PluginInitializerManager] Initializing plugins..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:34] [Paper Plugin Remapper Thread - 2\/INFO]:", + "lines": [ + { + "number": 4, + "content": "[13:16:34] [Paper Plugin Remapper Thread - 2\/INFO]: [PluginRemapper] Remapping plugin 'plugins\/mclogs-bukkit-dev.jar'..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:35] [Paper Plugin Remapper Thread - 2\/INFO]:", + "lines": [ + { + "number": 5, + "content": "[13:16:35] [Paper Plugin Remapper Thread - 2\/INFO]: [PluginRemapper] Done remapping plugin 'plugins\/mclogs-bukkit-dev.jar' in 971ms." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:35] [ServerMain\/INFO]:", + "lines": [ + { + "number": 6, + "content": "[13:16:35] [ServerMain\/INFO]: [PluginInitializerManager] Initialized 1 plugin" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:35] [ServerMain\/INFO]:", + "lines": [ + { + "number": 7, + "content": "[13:16:35] [ServerMain\/INFO]: [PluginInitializerManager] Bukkit plugins (1):" + }, + { + "number": 8, + "content": " - Mclogs (dev)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:39] [ServerMain\/INFO]:", + "lines": [ + { + "number": 9, + "content": "[13:16:39] [ServerMain\/INFO]: Environment: Environment[sessionHost=https:\/\/sessionserver.mojang.com, servicesHost=https:\/\/api.minecraftservices.com, name=PROD]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:40] [ServerMain\/INFO]:", + "lines": [ + { + "number": 10, + "content": "[13:16:40] [ServerMain\/INFO]: Loaded 1290 recipes" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:41] [ServerMain\/INFO]:", + "lines": [ + { + "number": 11, + "content": "[13:16:41] [ServerMain\/INFO]: Loaded 1399 advancements" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 12, + "content": "[13:16:41] [Server thread\/INFO]: Starting minecraft server version 1.21.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 13, + "content": "[13:16:41] [Server thread\/INFO]: Loading properties" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 14, + "content": "[13:16:41] [Server thread\/INFO]: This server is running Paper version 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:42] [Server thread\/INFO]:", + "lines": [ + { + "number": 15, + "content": "[13:16:42] [Server thread\/INFO]: [spark] This server bundles the spark profiler. For more information please visit https:\/\/docs.papermc.io\/paper\/profiling" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:42] [Server thread\/INFO]:", + "lines": [ + { + "number": 16, + "content": "[13:16:42] [Server thread\/INFO]: Server Ping Player Sample Count: 12" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:42] [Server thread\/INFO]:", + "lines": [ + { + "number": 17, + "content": "[13:16:42] [Server thread\/INFO]: Using 4 threads for Netty based IO" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 18, + "content": "[13:16:43] [Server thread\/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I\/O threads, 1 worker threads, and population gen parallelism of 1 threads" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 19, + "content": "[13:16:43] [Server thread\/INFO]: Default game type: SURVIVAL" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 20, + "content": "[13:16:43] [Server thread\/INFO]: Generating keypair" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 21, + "content": "[13:16:43] [Server thread\/INFO]: Starting Minecraft server on *:16754" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 22, + "content": "[13:16:43] [Server thread\/INFO]: Using epoll channel type" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 23, + "content": "[13:16:43] [Server thread\/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 24, + "content": "[13:16:43] [Server thread\/INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity." + } + ] + }, + { + "level": 3, + "time": null, + "prefix": "[13:16:43] [Server thread\/ERROR]:", + "lines": [ + { + "number": 25, + "content": "[13:16:43] [Server thread\/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'mclogs-bukkit-dev.jar' in folder 'plugins\/.paper-remapped'" + }, + { + "number": 26, + "content": "org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.25" + }, + { + "number": 27, + "content": "\tat org.bukkit.craftbukkit.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:369) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 28, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:121) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 29, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 30, + "content": "\tat io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 31, + "content": "\tat io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 32, + "content": "\tat io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 33, + "content": "\tat org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 34, + "content": "\tat net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 35, + "content": "\tat net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 36, + "content": "\tat net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 37, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) ~[?:?]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 38, + "content": "[13:16:43] [Server thread\/INFO]: Server permissions file permissions.yml is empty, ignoring it" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:43] [Server thread\/INFO]:", + "lines": [ + { + "number": 39, + "content": "[13:16:43] [Server thread\/INFO]: Preparing level \"world\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:44] [Server thread\/INFO]:", + "lines": [ + { + "number": 40, + "content": "[13:16:44] [Server thread\/INFO]: Preparing start region for dimension minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 41, + "content": "[13:16:45] [Server thread\/INFO]: Time elapsed: 1395 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 42, + "content": "[13:16:45] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_nether" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 43, + "content": "[13:16:45] [Server thread\/INFO]: Time elapsed: 204 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 44, + "content": "[13:16:45] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_end" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 45, + "content": "[13:16:45] [Server thread\/INFO]: Time elapsed: 124 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:45] [Server thread\/INFO]:", + "lines": [ + { + "number": 46, + "content": "[13:16:45] [Server thread\/INFO]: [spark] Starting background profiler..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:46] [Server thread\/INFO]:", + "lines": [ + { + "number": 47, + "content": "[13:16:46] [Server thread\/INFO]: Done preparing level \"world\" (2.566s)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:46] [Server thread\/INFO]:", + "lines": [ + { + "number": 48, + "content": "[13:16:46] [Server thread\/INFO]: Starting GS4 status listener" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:46] [Server thread\/INFO]:", + "lines": [ + { + "number": 49, + "content": "[13:16:46] [Server thread\/INFO]: Thread Query Listener started" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:46] [Query Listener #1\/INFO]:", + "lines": [ + { + "number": 50, + "content": "[13:16:46] [Query Listener #1\/INFO]: Query running on 0.0.0.0:9898" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:46] [Server thread\/INFO]:", + "lines": [ + { + "number": 51, + "content": "[13:16:46] [Server thread\/INFO]: JMX monitoring enabled" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:46] [Server thread\/INFO]:", + "lines": [ + { + "number": 52, + "content": "[13:16:46] [Server thread\/INFO]: Running delayed init tasks" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:46] [Server thread\/INFO]:", + "lines": [ + { + "number": 53, + "content": "[13:16:46] [Server thread\/INFO]: Done (12.888s)! For help, type \"help\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:16:46] [Server thread\/INFO]:", + "lines": [ + { + "number": 54, + "content": "[13:16:46] [Server thread\/INFO]: Timings Reset" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 55, + "content": "[13:17:27] [Server thread\/INFO]: Stopping the server" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 56, + "content": "[13:17:27] [Server thread\/INFO]: Stopping server" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 57, + "content": "[13:17:27] [Server thread\/INFO]: Saving players" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 58, + "content": "[13:17:27] [Server thread\/INFO]: Saving worlds" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 59, + "content": "[13:17:27] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world]'\/minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 60, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 61, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 62, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 63, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world' in 0.33s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 64, + "content": "[13:17:27] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world_nether]'\/minecraft:the_nether" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 65, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 66, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 67, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 68, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_nether' in 0.06s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 69, + "content": "[13:17:27] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'\/minecraft:the_end" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 70, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 71, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 72, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 73, + "content": "[13:17:27] [Server thread\/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_the_end' in 0.05s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 74, + "content": "[13:17:27] [Server thread\/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 75, + "content": "[13:17:27] [Server thread\/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 76, + "content": "[13:17:27] [Server thread\/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[13:17:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 77, + "content": "[13:17:27] [Server thread\/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved" + } + ] + } + ], + "analysis": { + "problems": [ + { + "message": "The plugin 'mclogs-bukkit-dev' needs version '1.25' of your server software.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[13:16:43] [Server thread\/ERROR]:", + "lines": [ + { + "number": 25, + "content": "[13:16:43] [Server thread\/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'mclogs-bukkit-dev.jar' in folder 'plugins\/.paper-remapped'" + }, + { + "number": 26, + "content": "org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.25" + }, + { + "number": 27, + "content": "\tat org.bukkit.craftbukkit.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:369) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 28, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:121) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 29, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 30, + "content": "\tat io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 31, + "content": "\tat io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 32, + "content": "\tat io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 33, + "content": "\tat org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 34, + "content": "\tat net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 35, + "content": "\tat net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 36, + "content": "\tat net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 37, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) ~[?:?]" + } + ] + }, + "solutions": [ + { + "message": "Install a different version of the plugin 'mclogs-bukkit-dev'." + }, + { + "message": "Delete the file 'plugins\/mclogs-bukkit-dev.jar'." + }, + { + "message": "Install the version '1.25' of your server software." + } + ] + } + ], + "information": [ + { + "message": "Minecraft version: 1.21.1", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[13:16:41] [Server thread\/INFO]:", + "lines": [ + { + "number": 12, + "content": "[13:16:41] [Server thread\/INFO]: Starting minecraft server version 1.21.1" + } + ] + }, + "label": "Minecraft version", + "value": "1.21.1" + } + ] + } +} \ No newline at end of file diff --git a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.log b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.log new file mode 100644 index 00000000..8fe8a043 --- /dev/null +++ b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.log @@ -0,0 +1,77 @@ +[13:16:33] [ServerMain/INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS; Eclipse Adoptium Temurin-21.0.3+9) on Linux 5.15.0-117-generic (amd64) +[13:16:33] [ServerMain/INFO]: [bootstrap] Loading Paper 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) for Minecraft 1.21.1 +[13:16:34] [ServerMain/INFO]: [PluginInitializerManager] Initializing plugins... +[13:16:34] [Paper Plugin Remapper Thread - 2/INFO]: [PluginRemapper] Remapping plugin 'plugins/mclogs-bukkit-dev.jar'... +[13:16:35] [Paper Plugin Remapper Thread - 2/INFO]: [PluginRemapper] Done remapping plugin 'plugins/mclogs-bukkit-dev.jar' in 971ms. +[13:16:35] [ServerMain/INFO]: [PluginInitializerManager] Initialized 1 plugin +[13:16:35] [ServerMain/INFO]: [PluginInitializerManager] Bukkit plugins (1): + - Mclogs (dev) +[13:16:39] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD] +[13:16:40] [ServerMain/INFO]: Loaded 1290 recipes +[13:16:41] [ServerMain/INFO]: Loaded 1399 advancements +[13:16:41] [Server thread/INFO]: Starting minecraft server version 1.21.1 +[13:16:41] [Server thread/INFO]: Loading properties +[13:16:41] [Server thread/INFO]: This server is running Paper version 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT) +[13:16:42] [Server thread/INFO]: [spark] This server bundles the spark profiler. For more information please visit https://docs.papermc.io/paper/profiling +[13:16:42] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[13:16:42] [Server thread/INFO]: Using 4 threads for Netty based IO +[13:16:43] [Server thread/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I/O threads, 1 worker threads, and population gen parallelism of 1 threads +[13:16:43] [Server thread/INFO]: Default game type: SURVIVAL +[13:16:43] [Server thread/INFO]: Generating keypair +[13:16:43] [Server thread/INFO]: Starting Minecraft server on *:16754 +[13:16:43] [Server thread/INFO]: Using epoll channel type +[13:16:43] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[13:16:43] [Server thread/INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity. +[13:16:43] [Server thread/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'mclogs-bukkit-dev.jar' in folder 'plugins/.paper-remapped' +org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.25 + at org.bukkit.craftbukkit.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:369) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:121) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] +[13:16:43] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[13:16:43] [Server thread/INFO]: Preparing level "world" +[13:16:44] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[13:16:45] [Server thread/INFO]: Time elapsed: 1395 ms +[13:16:45] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether +[13:16:45] [Server thread/INFO]: Time elapsed: 204 ms +[13:16:45] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end +[13:16:45] [Server thread/INFO]: Time elapsed: 124 ms +[13:16:45] [Server thread/INFO]: [spark] Starting background profiler... +[13:16:46] [Server thread/INFO]: Done preparing level "world" (2.566s) +[13:16:46] [Server thread/INFO]: Starting GS4 status listener +[13:16:46] [Server thread/INFO]: Thread Query Listener started +[13:16:46] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[13:16:46] [Server thread/INFO]: JMX monitoring enabled +[13:16:46] [Server thread/INFO]: Running delayed init tasks +[13:16:46] [Server thread/INFO]: Done (12.888s)! For help, type "help" +[13:16:46] [Server thread/INFO]: Timings Reset +[13:17:27] [Server thread/INFO]: Stopping the server +[13:17:27] [Server thread/INFO]: Stopping server +[13:17:27] [Server thread/INFO]: Saving players +[13:17:27] [Server thread/INFO]: Saving worlds +[13:17:27] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world' +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world' +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world' +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world' in 0.33s +[13:17:27] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether' +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether' +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether' +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_nether' in 0.06s +[13:17:27] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end' +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end' +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end' +[13:17:27] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_the_end' in 0.05s +[13:17:27] [Server thread/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved +[13:17:27] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved +[13:17:27] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved +[13:17:27] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved \ No newline at end of file diff --git a/test/tests/Logs/AutoLogsTest.php b/test/tests/Logs/AutoLogsTest.php index 1c2ef9a0..f0359f05 100644 --- a/test/tests/Logs/AutoLogsTest.php +++ b/test/tests/Logs/AutoLogsTest.php @@ -404,6 +404,16 @@ public function test_paper_multiple_dependencies_1_20_4(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_paper_multiple_depepdencies_1_21_1(): void + { + $log = new TestLog('Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception @@ -444,6 +454,16 @@ public function test_paper_plugin_dependency_1_20_4(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_paper_plugin_dependency_1_21_1(): void + { + $log = new TestLog('Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception @@ -484,6 +504,16 @@ public function test_paper_plugin_unsupported_class_version_1_20_4(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_paper_plugin_unsupported_class_version_1_21_1(): void + { + $log = new TestLog('Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception @@ -534,6 +564,16 @@ public function test_paper_unsupported_api_version_1_20_4(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_paper_unsupported_api_version_1_21_1(): void + { + $log = new TestLog('Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception From 7dfbdb746d66d44cd208ef73a45bf5b5d8db2caf Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 13:42:04 +0200 Subject: [PATCH 03/20] Simplify regex for PluginDependenciesProblem and PluginDependencyProblem and use pathinfo to extract the plugin name from the plugin path --- src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php | 6 +++--- src/Analysis/Problem/Bukkit/PluginDependencyProblem.php | 6 +++--- .../Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json | 2 +- .../Bukkit/Paper/paper-plugin-dependency-1-21-1.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index 852ee3b6..2e615abe 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -89,7 +89,7 @@ public function getMessage(): string public static function getPatterns(): array { return [ - '/Could not load \'(plugins[\/\\\]((?!\.jar).*)\.jar)\' in (?:folder )?\'[^\']+\'' + '/Could not load \'(plugins[\/\\\][^\']+\.jar)\' in (?:folder )?\'[^\']+\'' . '\norg\.bukkit\.plugin\.UnknownDependencyException\: Unknown\/missing dependency plugins: \[([\w ,]+)\]/']; } @@ -103,8 +103,8 @@ public static function getPatterns(): array public function setMatches(array $matches, mixed $patternKey): void { $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); - $this->pluginName = $matches[2]; - $this->dependencyPluginNames = preg_split("/, ?/", $matches[3]); + $this->pluginName = pathinfo($this->pluginPath, PATHINFO_FILENAME); + $this->dependencyPluginNames = preg_split("/, ?/", $matches[2]); foreach ($this->dependencyPluginNames as $name) { $this->addSolution((new PluginInstallSolution())->setPluginName($name)); diff --git a/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php b/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php index dac26ef3..7cc620f1 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php @@ -65,7 +65,7 @@ public function getMessage(): string public static function getPatterns(): array { return [ - '/Could not load \'(plugins[\/\\\]((?!\.jar).*)\.jar)\' in (?:folder )?\'[^\']+\'' + '/Could not load \'(plugins[\/\\\][^\']+\.jar)\' in (?:folder )?\'[^\']+\'' . '\norg\.bukkit\.plugin\.UnknownDependencyException\: (?:(\w+)\n|Unknown dependency (\w+)\.)/']; } @@ -79,8 +79,8 @@ public static function getPatterns(): array public function setMatches(array $matches, mixed $patternKey): void { $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); - $this->pluginName = $matches[2]; - $this->dependencyPluginName = $matches[3] ?: $matches[4]; + $this->pluginName = pathinfo($this->pluginPath, PATHINFO_FILENAME); + $this->dependencyPluginName = $matches[2] ?: $matches[3]; $this->addSolution((new PluginInstallSolution())->setPluginName($this->getDependencyPluginName())); $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json index 1cf280ec..d44e27d6 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json @@ -478,7 +478,7 @@ "analysis": { "problems": [ { - "message": "The plugin '.paper-remapped\/mclogs-bukkit-2.6.3' is missing the required plugins 'example1', 'example2'.", + "message": "The plugin 'mclogs-bukkit-2.6.3' is missing the required plugins 'example1', 'example2'.", "counter": 1, "entry": { "level": 3, diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json index 42eb0334..1fe62f66 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json @@ -753,7 +753,7 @@ "analysis": { "problems": [ { - "message": "The plugin '.paper-remapped\/worldguard-bukkit-7.0.12-dist' is missing the required plugin 'WorldEdit'.", + "message": "The plugin 'worldguard-bukkit-7.0.12-dist' is missing the required plugin 'WorldEdit'.", "counter": 1, "entry": { "level": 3, From c7a21b0293874477b4a353caaa2cdddf35f48ecd Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 14:57:36 +0200 Subject: [PATCH 04/20] Rename PluginProblem to BukkitPluginProblem, introduce PaperPluginProblem, add correctPluginPath() and extractPluginName() to BukkitPluginProblem --- ...ginProblem.php => BukkitPluginProblem.php} | 24 ++++++++++++++++++- .../Bukkit/PluginCommandExceptionProblem.php | 2 +- .../Problem/Bukkit/PluginDisablingProblem.php | 2 +- .../Problem/Bukkit/PluginEnablingProblem.php | 2 +- .../Problem/Bukkit/PluginLoadProblem.php | 2 +- .../Problem/Bukkit/PluginRuntimeProblem.php | 2 +- .../Bukkit/UnsupportedApiVersionProblem.php | 2 +- .../Bukkit/UnsupportedClassVersionProblem.php | 2 +- .../Problem/Paper/PaperPluginProblem.php | 10 ++++++++ 9 files changed, 40 insertions(+), 8 deletions(-) rename src/Analysis/Problem/Bukkit/{PluginProblem.php => BukkitPluginProblem.php} (66%) create mode 100644 src/Analysis/Problem/Paper/PaperPluginProblem.php diff --git a/src/Analysis/Problem/Bukkit/PluginProblem.php b/src/Analysis/Problem/Bukkit/BukkitPluginProblem.php similarity index 66% rename from src/Analysis/Problem/Bukkit/PluginProblem.php rename to src/Analysis/Problem/Bukkit/BukkitPluginProblem.php index bdde4b84..6fb5f84c 100644 --- a/src/Analysis/Problem/Bukkit/PluginProblem.php +++ b/src/Analysis/Problem/Bukkit/BukkitPluginProblem.php @@ -11,7 +11,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -abstract class PluginProblem extends BukkitProblem +abstract class BukkitPluginProblem extends BukkitProblem { protected ?string $pluginName = null; @@ -46,4 +46,26 @@ public function isEqual(InsightInterface $insight): bool { return $insight instanceof static && $this->getPluginName() === $insight->getPluginName(); } + + /** + * Corrects the plugin path by removing the ".paper-remapped/" part + * + * @param string $pluginPath + * @return string + */ + protected function correctPluginPath(string $pluginPath): string + { + return str_replace("plugins/.paper-remapped/", "plugins/", $pluginPath); + } + + /** + * Extracts the plugin name from a plugin path + * + * @param string $pluginPath + * @return string + */ + protected function extractPluginName(string $pluginPath): string + { + return pathinfo($pluginPath, PATHINFO_FILENAME); + } } \ No newline at end of file diff --git a/src/Analysis/Problem/Bukkit/PluginCommandExceptionProblem.php b/src/Analysis/Problem/Bukkit/PluginCommandExceptionProblem.php index 8bdbb69d..0dd5e0f1 100644 --- a/src/Analysis/Problem/Bukkit/PluginCommandExceptionProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginCommandExceptionProblem.php @@ -12,7 +12,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginCommandExceptionProblem extends PluginProblem +class PluginCommandExceptionProblem extends BukkitPluginProblem { protected ?string $command = null; diff --git a/src/Analysis/Problem/Bukkit/PluginDisablingProblem.php b/src/Analysis/Problem/Bukkit/PluginDisablingProblem.php index 162ea9f7..24fc251f 100644 --- a/src/Analysis/Problem/Bukkit/PluginDisablingProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDisablingProblem.php @@ -9,7 +9,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginDisablingProblem extends PluginProblem +class PluginDisablingProblem extends BukkitPluginProblem { /** * Get a human-readable message diff --git a/src/Analysis/Problem/Bukkit/PluginEnablingProblem.php b/src/Analysis/Problem/Bukkit/PluginEnablingProblem.php index 47e5b3e0..7985ddd1 100644 --- a/src/Analysis/Problem/Bukkit/PluginEnablingProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginEnablingProblem.php @@ -9,7 +9,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginEnablingProblem extends PluginProblem +class PluginEnablingProblem extends BukkitPluginProblem { /** * Get a human-readable message diff --git a/src/Analysis/Problem/Bukkit/PluginLoadProblem.php b/src/Analysis/Problem/Bukkit/PluginLoadProblem.php index 15dcecff..a14d89d8 100644 --- a/src/Analysis/Problem/Bukkit/PluginLoadProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginLoadProblem.php @@ -12,7 +12,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginLoadProblem extends PluginProblem +class PluginLoadProblem extends BukkitPluginProblem { protected ?string $pluginPath = null; diff --git a/src/Analysis/Problem/Bukkit/PluginRuntimeProblem.php b/src/Analysis/Problem/Bukkit/PluginRuntimeProblem.php index d738bf23..4b3b9d66 100644 --- a/src/Analysis/Problem/Bukkit/PluginRuntimeProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginRuntimeProblem.php @@ -9,7 +9,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginRuntimeProblem extends PluginProblem +class PluginRuntimeProblem extends BukkitPluginProblem { /** * Get a human-readable message diff --git a/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php index 460aa4eb..f27c8cb7 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php @@ -7,7 +7,7 @@ use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; use Aternos\Codex\Minecraft\Translator\Translator; -class UnsupportedApiVersionProblem extends PluginProblem +class UnsupportedApiVersionProblem extends BukkitPluginProblem { protected ?string $pluginPath = null; diff --git a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php index aef752cf..6cd0311d 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php @@ -6,7 +6,7 @@ use Aternos\Codex\Minecraft\Analysis\Solution\UpdateJavaSolution; use Aternos\Codex\Minecraft\Translator\Translator; -class UnsupportedClassVersionProblem extends PluginProblem +class UnsupportedClassVersionProblem extends BukkitPluginProblem { protected ?string $pluginPath = null; diff --git a/src/Analysis/Problem/Paper/PaperPluginProblem.php b/src/Analysis/Problem/Paper/PaperPluginProblem.php new file mode 100644 index 00000000..8574ecb7 --- /dev/null +++ b/src/Analysis/Problem/Paper/PaperPluginProblem.php @@ -0,0 +1,10 @@ + Date: Wed, 2 Oct 2024 14:59:11 +0200 Subject: [PATCH 05/20] Make more plugin problems depend on BukkitPluginProblem, use correctPluginPath() instead of str_replace --- .../Problem/Bukkit/AmbiguousPluginNameProblem.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php b/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php index 7fe31eee..55403841 100644 --- a/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php +++ b/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php @@ -11,11 +11,10 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class AmbiguousPluginNameProblem extends BukkitProblem +class AmbiguousPluginNameProblem extends BukkitPluginProblem { protected ?string $firstPluginPath = null; protected ?string $secondPluginPath = null; - protected ?string $pluginName = null; /** * Get a human-readable message @@ -62,8 +61,8 @@ public static function getPatterns(): array public function setMatches(array $matches, mixed $patternKey): void { $this->pluginName = $matches[1]; - $this->firstPluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[2]); - $this->secondPluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[3]); + $this->firstPluginPath = $this->correctPluginPath($matches[2]); + $this->secondPluginPath = $this->correctPluginPath($matches[3]); $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getFirstPluginPath())); $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getSecondPluginPath())); @@ -85,14 +84,6 @@ public function getSecondPluginPath(): string return $this->secondPluginPath; } - /** - * @return string - */ - public function getPluginName(): string - { - return $this->pluginName; - } - /** * @param InsightInterface $insight * @return bool From fdb1b4fc0ced9c8d0e86c405928bc2cbcfc50f88 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 15:00:09 +0200 Subject: [PATCH 06/20] Make ApiVersionLowerThanAllowedProblem extend PaperPluginProblem and remove $pluginName member and usages --- .../Paper/ApiVersionLowerThanAllowedProblem.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php b/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php index ff82feaa..d7b11434 100644 --- a/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php +++ b/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php @@ -12,9 +12,8 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Paper */ -class ApiVersionLowerThanAllowedProblem extends PaperProblem +class ApiVersionLowerThanAllowedProblem extends PaperPluginProblem { - protected ?string $pluginName = null; protected ?string $pluginApiVersion = null; /** @@ -53,14 +52,6 @@ public function setMatches(array $matches, mixed $patternKey): void $this->addSolution((new ChangeMinimumAllowedApiVersionSolution())->setApiVersion($this->getPluginApiVersion())); } - /** - * @return string|null - */ - public function getPluginName(): ?string - { - return $this->pluginName; - } - /** * @return string|null */ From 47d8d972134bce4e21ee8997da746fe913c1cee0 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 15:01:00 +0200 Subject: [PATCH 07/20] Simplify regex and use extractPluginName --- .../Problem/Paper/ApiVersionLowerThanAllowedProblem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php b/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php index d7b11434..116fe655 100644 --- a/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php +++ b/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php @@ -34,7 +34,7 @@ public function getMessage(): string public static function getPatterns(): array { return [ - '/Could not load plugin \'((?!\.jar).*)\.jar\' in folder \'[^\']+\'' + '/Could not load plugin \'((?!\.jar).*\.jar)\' in folder \'[^\']+\'' . '\norg.bukkit.plugin.InvalidPluginException: Plugin API version (\d+\.\d+) is lower than the minimum allowed version\. Please update or replace it\./' ]; } @@ -44,7 +44,7 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginName = $matches[1]; + $this->pluginName = $this->extractPluginName($matches[1]); $this->pluginApiVersion = $matches[2]; $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); From 943bce88d842ba5ec14aac0bd497f43caef89b59 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 15:02:47 +0200 Subject: [PATCH 08/20] Use BukkitPluginProblem in more places, simplify regexes and use extractPluginName instead, remove pluginPath and use PluginRemoveSolution instead of FileDeleteSolution --- .../Bukkit/PluginDependenciesProblem.php | 30 +++--------------- .../Bukkit/PluginDependencyProblem.php | 28 +++-------------- .../Problem/Bukkit/PluginLoadProblem.php | 31 +++---------------- .../Bukkit/UnsupportedApiVersionProblem.php | 27 ++++------------ .../Bukkit/UnsupportedClassVersionProblem.php | 29 +++++------------ 5 files changed, 27 insertions(+), 118 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index 2e615abe..d83910d2 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -4,7 +4,7 @@ use Aternos\Codex\Analysis\InsightInterface; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; use Aternos\Codex\Minecraft\Translator\Translator; /** @@ -12,32 +12,13 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginDependenciesProblem extends BukkitProblem +class PluginDependenciesProblem extends BukkitPluginProblem { - protected ?string $pluginPath = null; - protected ?string $pluginName = null; - /** * @var string[] */ protected array $dependencyPluginNames = []; - /** - * @return string|null - */ - public function getPluginPath(): ?string - { - return $this->pluginPath; - } - - /** - * @return string|null - */ - public function getPluginName(): ?string - { - return $this->pluginName; - } - /** * get a list of missing dependencies * @return string[] @@ -102,14 +83,13 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); - $this->pluginName = pathinfo($this->pluginPath, PATHINFO_FILENAME); + $this->pluginName = $this->extractPluginName($matches[1]); $this->dependencyPluginNames = preg_split("/, ?/", $matches[2]); foreach ($this->dependencyPluginNames as $name) { $this->addSolution((new PluginInstallSolution())->setPluginName($name)); } - $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); + $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); } /** @@ -122,7 +102,7 @@ public function isEqual(InsightInterface $insight): bool return false; } - if ($this->getPluginName() !== $insight->getPluginName() || $this->getPluginPath() !== $insight->getPluginPath()) { + if ($this->getPluginName() !== $insight->getPluginName()) { return false; } diff --git a/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php b/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php index 7cc620f1..e1868867 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php @@ -4,7 +4,7 @@ use Aternos\Codex\Analysis\InsightInterface; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; use Aternos\Codex\Minecraft\Translator\Translator; /** @@ -12,28 +12,10 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginDependencyProblem extends BukkitProblem +class PluginDependencyProblem extends BukkitPluginProblem { - protected ?string $pluginPath = null; - protected ?string $pluginName = null; protected ?string $dependencyPluginName = null; - /** - * @return string|null - */ - public function getPluginPath(): ?string - { - return $this->pluginPath; - } - - /** - * @return string|null - */ - public function getPluginName(): ?string - { - return $this->pluginName; - } - /** * @return string|null */ @@ -78,12 +60,11 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); - $this->pluginName = pathinfo($this->pluginPath, PATHINFO_FILENAME); + $this->pluginName = $this->extractPluginName($matches[1]); $this->dependencyPluginName = $matches[2] ?: $matches[3]; $this->addSolution((new PluginInstallSolution())->setPluginName($this->getDependencyPluginName())); - $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); + $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); } /** @@ -94,7 +75,6 @@ public function isEqual(InsightInterface $insight): bool { return $insight instanceof static && $this->getPluginName() === $insight->getPluginName() - && $this->getPluginPath() === $insight->getPluginPath() && $this->getDependencyPluginName() === $insight->getDependencyPluginName(); } } \ No newline at end of file diff --git a/src/Analysis/Problem/Bukkit/PluginLoadProblem.php b/src/Analysis/Problem/Bukkit/PluginLoadProblem.php index a14d89d8..4622fc68 100644 --- a/src/Analysis/Problem/Bukkit/PluginLoadProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginLoadProblem.php @@ -2,9 +2,8 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Bukkit; -use Aternos\Codex\Analysis\InsightInterface; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; use Aternos\Codex\Minecraft\Translator\Translator; /** @@ -14,8 +13,6 @@ */ class PluginLoadProblem extends BukkitPluginProblem { - protected ?string $pluginPath = null; - /** * Get a human-readable message * @@ -36,7 +33,7 @@ public function getMessage(): string public static function getPatterns(): array { return [ - '/Could not load \'(plugins[\/\\\]((?!\.jar).*)\.jar)\' in folder \'[^\']+\'' + '/Could not load \'(plugins[\/\\\][^\']+\.jar)\' in (?:folder )?\'[^\']+\'' . '(?!\n(org.bukkit.plugin.UnknownDependencyException|org.bukkit.plugin.InvalidPluginException\: (Unsupported API version|java\.lang\.UnsupportedClassVersionError)))/' ]; } @@ -50,29 +47,9 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); - $this->pluginName = $matches[2]; + $this->pluginName = $this->extractPluginName($matches[1]); $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); - $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); - } - - /** - * @return string|null - */ - public function getPluginPath(): ?string - { - return $this->pluginPath; - } - - /** - * @param InsightInterface $insight - * @return bool - */ - public function isEqual(InsightInterface $insight): bool - { - return $insight instanceof static - && $this->getPluginPath() === $insight->getPluginPath() - && parent::isEqual($insight); + $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); } } \ No newline at end of file diff --git a/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php index f27c8cb7..ed76a2f4 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php @@ -3,24 +3,14 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Bukkit; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\ServerInstallDifferentVersionSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; use Aternos\Codex\Minecraft\Translator\Translator; class UnsupportedApiVersionProblem extends BukkitPluginProblem { - protected ?string $pluginPath = null; - protected ?string $apiVersion = null; - /** - * @return string|null - */ - public function getPluginPath(): ?string - { - return $this->pluginPath; - } - /** * @return string|null */ @@ -51,16 +41,11 @@ public function getMessage(): string */ public function setMatches(array $matches, mixed $patternKey): void { - $pluginFileName = $matches[1]; // worldedit-bukkit-7.3.4-beta-01.jar - $pluginName = $matches[2]; // worldedit-bukkit-7.3.4-beta-01 - $folderName = str_replace("plugins/.paper-remapped", "plugins", $matches[3]); // plugins or plugins/.paper-remapped - - $this->pluginPath = $folderName . '/' . $pluginFileName; - $this->pluginName = $pluginName; - $this->apiVersion = $matches[4]; + $this->pluginName = $this->extractPluginName($matches[1]); + $this->apiVersion = $matches[2]; $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); - $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); + $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); $this->addSolution((new ServerInstallDifferentVersionSolution())->setSoftwareVersion($this->getApiVersion())); } @@ -76,10 +61,10 @@ public static function getPatterns(): array { return [ // < 1.20 - '/Could not load \'plugins[\/\\\](((?!\.jar).*)\.jar)\' in folder \'([^\']+)\'' + '/Could not load \'plugins[\/\\\]([^\']+\.jar)\' in (?:folder )?\'[^\']+\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: Unsupported API version ([0-9]+\.[0-9]+)/', // >= 1.20 - '/Could not load plugin \'(((?!\.jar).*)\.jar)\' in folder \'([^\']+)\'' + '/Could not load plugin \'((?!\.jar).*\.jar)\' in folder \'[^\']+\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: Unsupported API version ([0-9]+\.[0-9]+)/', ]; } diff --git a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php index 6cd0311d..6be91e75 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php @@ -2,24 +2,15 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Bukkit; -use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; use Aternos\Codex\Minecraft\Analysis\Solution\UpdateJavaSolution; use Aternos\Codex\Minecraft\Translator\Translator; class UnsupportedClassVersionProblem extends BukkitPluginProblem { - protected ?string $pluginPath = null; - protected ?string $classFileVersion = null; - /** - * @return string|null - */ - public function getPluginPath(): ?string - { - return $this->pluginPath; - } - /** * @return string|null */ @@ -50,15 +41,11 @@ public function getMessage(): string */ public function setMatches(array $matches, mixed $patternKey): void { - $pluginFileName = $matches[1]; // worldedit-bukkit-7.3.4-beta-01.jar - $pluginName = $matches[2]; // worldedit-bukkit-7.3.4-beta-01 - $folderName = str_replace("plugins/.paper-remapped", "plugins", $matches[3]); // plugins or plugins/.paper-remapped - - $this->pluginPath = $folderName . '/' . $pluginFileName; - $this->pluginName = $pluginName; - $this->classFileVersion = $matches[4]; + $this->pluginName = $this->extractPluginName($matches[1]); + $this->classFileVersion = $matches[2]; - $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); + $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); + $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); $this->addSolution((new UpdateJavaSolution())->setVersion($this->getJavaVersion())); } @@ -74,10 +61,10 @@ public static function getPatterns(): array { return [ // < 1.20 - '/Could not load \'plugins[\/\\\](((?!\.jar).*)\.jar)\' in folder \'([^\']+)\'' + '/Could not load \'plugins[\/\\\]([^\']+\.jar)\' in (?:folder )?\'[^\']+\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: java\.lang\.UnsupportedClassVersionError: .+ \(class file version (\d+)\.\d+\)/', // >= 1.20 - '/Could not load plugin \'(((?!\.jar).*)\.jar)\' in folder \'([^\']+)\'' + '/Could not load plugin \'((?!\.jar).*\.jar)\' in folder \'[^\']+\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: java\.lang\.UnsupportedClassVersionError: .+ \(class file version (\d+)\.\d+\)/' ]; } From 69a1f1132998040674377887a79e10c91b7eca43 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 15:03:19 +0200 Subject: [PATCH 09/20] Regenerate tests --- .../paper-multiple-dependencies-1-18-2.json | 2 +- .../paper-multiple-dependencies-1-20-4.json | 2 +- .../paper-multiple-depepdencies-1-21-1.json | 2 +- ...paper-plugin-dependency-1-18-2-duplicate.json | 2 +- .../Paper/paper-plugin-dependency-1-18-2.json | 2 +- .../Paper/paper-plugin-dependency-1-20-4.json | 2 +- .../Paper/paper-plugin-dependency-1-21-1.json | 2 +- .../Paper/paper-plugin-dependency-1161.json | 2 +- ...-plugin-unsupported-class-version-1-16-5.json | 5 ++++- ...-plugin-unsupported-class-version-1-20-4.json | 5 ++++- ...-plugin-unsupported-class-version-1-21-1.json | 5 ++++- .../paper-unsupported-api-version-1-18-2.json | 2 +- .../paper-unsupported-api-version-1-20-4.json | 2 +- .../paper-unsupported-api-version-1-21-1.json | 2 +- .../Bukkit/Spigot/spigot-plugin-dependency.json | 4 ++-- .../Bukkit/Spigot/spigot-plugin-load.json | 2 +- .../Bukkit/plugin/spigot-authme-shutdown.json | 2 +- .../plugin/spigot-permissionsex-config.json | 16 ++++++++-------- .../Forge/Magma/magma-plugin-dependency.json | 4 ++-- 19 files changed, 37 insertions(+), 28 deletions(-) diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json index e8d82555..e1f45b04 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json @@ -405,7 +405,7 @@ "message": "Install the plugin 'example1'." }, { - "message": "Delete the file 'plugins\/mclogs-bukkit-2.3.1.jar'." + "message": "Remove the plugin 'mclogs-bukkit-2.3.1'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json index 022d755e..f75d0db7 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json @@ -462,7 +462,7 @@ "message": "Install the plugin 'example2'." }, { - "message": "Delete the file 'plugins\/mclogs-bukkit-2.3.1.jar'." + "message": "Remove the plugin 'mclogs-bukkit-2.3.1'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json index d44e27d6..e3dcca1f 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json @@ -535,7 +535,7 @@ "message": "Install the plugin 'example2'." }, { - "message": "Delete the file 'plugins\/mclogs-bukkit-2.6.3.jar'." + "message": "Remove the plugin 'mclogs-bukkit-2.6.3'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json index 2d35eff6..3f8789c0 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json @@ -419,7 +419,7 @@ "message": "Install the plugin 'ViaVersion'." }, { - "message": "Delete the file 'plugins\/ViaBackwards-4.2.1.jar'." + "message": "Remove the plugin 'ViaBackwards-4.2.1'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json index c8adcab8..ba1c1915 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json @@ -380,7 +380,7 @@ "message": "Install the plugin 'ViaVersion'." }, { - "message": "Delete the file 'plugins\/ViaBackwards-4.2.1.jar'." + "message": "Remove the plugin 'ViaBackwards-4.2.1'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json index 32a78b14..3f6f33a6 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json @@ -525,7 +525,7 @@ "message": "Install the plugin 'WorldEdit'." }, { - "message": "Delete the file 'plugins\/worldguard-bukkit-7.0.9-dist.jar'." + "message": "Remove the plugin 'worldguard-bukkit-7.0.9-dist'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json index 1fe62f66..a8c0d583 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json @@ -807,7 +807,7 @@ "message": "Install the plugin 'WorldEdit'." }, { - "message": "Delete the file 'plugins\/worldguard-bukkit-7.0.12-dist.jar'." + "message": "Remove the plugin 'worldguard-bukkit-7.0.12-dist'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1161.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1161.json index abf01987..99bb64f6 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1161.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1161.json @@ -435,7 +435,7 @@ "message": "Install the plugin 'LuckPerms'." }, { - "message": "Delete the file 'plugins\/LuckPermsChat-2.0.2.jar'." + "message": "Remove the plugin 'LuckPermsChat-2.0.2'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json index 3fb7aa4f..210b6788 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json @@ -571,7 +571,10 @@ }, "solutions": [ { - "message": "Delete the file 'plugins\/Slimefun4-1027.jar'." + "message": "Install a different version of the plugin 'Slimefun4-1027'." + }, + { + "message": "Remove the plugin 'Slimefun4-1027'." }, { "message": "Change your Java version to 16 or later." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json index 313fb702..84fd9e98 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json @@ -650,7 +650,10 @@ }, "solutions": [ { - "message": "Delete the file 'plugins\/worldedit-bukkit-7.3.4-beta-01.jar'." + "message": "Install a different version of the plugin 'worldedit-bukkit-7.3.4-beta-01'." + }, + { + "message": "Remove the plugin 'worldedit-bukkit-7.3.4-beta-01'." }, { "message": "Change your Java version to 21 or later." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json index a10af4d9..e9874ac9 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json @@ -940,7 +940,10 @@ }, "solutions": [ { - "message": "Delete the file 'plugins\/mclogs-bukkit-dev.jar'." + "message": "Install a different version of the plugin 'mclogs-bukkit-dev'." + }, + { + "message": "Remove the plugin 'mclogs-bukkit-dev'." }, { "message": "Change your Java version to 22 or later." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-18-2.json b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-18-2.json index 893a1724..b8bc595f 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-18-2.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-18-2.json @@ -426,7 +426,7 @@ "message": "Install a different version of the plugin 'AuctionHouse-1.19-3.3.1'." }, { - "message": "Delete the file 'plugins\/AuctionHouse-1.19-3.3.1.jar'." + "message": "Remove the plugin 'AuctionHouse-1.19-3.3.1'." }, { "message": "Install the version '1.19' of your server software." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-20-4.json index d8f72f46..1b485f6b 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-20-4.json @@ -483,7 +483,7 @@ "message": "Install a different version of the plugin 'worldedit-bukkit-7.3.4-beta-01'." }, { - "message": "Delete the file 'plugins\/worldedit-bukkit-7.3.4-beta-01.jar'." + "message": "Remove the plugin 'worldedit-bukkit-7.3.4-beta-01'." }, { "message": "Install the version '1.25' of your server software." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json index 7191ba46..ed68cd58 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json @@ -831,7 +831,7 @@ "message": "Install a different version of the plugin 'mclogs-bukkit-dev'." }, { - "message": "Delete the file 'plugins\/mclogs-bukkit-dev.jar'." + "message": "Remove the plugin 'mclogs-bukkit-dev'." }, { "message": "Install the version '1.25' of your server software." diff --git a/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-dependency.json b/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-dependency.json index 54e9b656..37dcdb47 100644 --- a/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-dependency.json +++ b/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-dependency.json @@ -268,7 +268,7 @@ "message": "Install the plugin 'Vault'." }, { - "message": "Delete the file 'plugins\/FactionsShop.jar'." + "message": "Remove the plugin 'FactionsShop'." } ] }, @@ -315,7 +315,7 @@ "message": "Install the plugin 'ProtocolLib'." }, { - "message": "Delete the file 'plugins\/BasicTab.jar'." + "message": "Remove the plugin 'BasicTab'." } ] } diff --git a/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-load.json b/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-load.json index c0843039..fe805071 100644 --- a/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-load.json +++ b/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-load.json @@ -255,7 +255,7 @@ "message": "Install a different version of the plugin 'GamenixText'." }, { - "message": "Delete the file 'plugins\/GamenixText.jar'." + "message": "Remove the plugin 'GamenixText'." } ] } diff --git a/test/data/Vanilla/Bukkit/plugin/spigot-authme-shutdown.json b/test/data/Vanilla/Bukkit/plugin/spigot-authme-shutdown.json index 9c86e028..e3d09a52 100644 --- a/test/data/Vanilla/Bukkit/plugin/spigot-authme-shutdown.json +++ b/test/data/Vanilla/Bukkit/plugin/spigot-authme-shutdown.json @@ -6103,7 +6103,7 @@ "message": "Install the plugin 'Languagy'." }, { - "message": "Delete the file 'plugins\/AnvilLogin.jar'." + "message": "Remove the plugin 'AnvilLogin'." } ] }, diff --git a/test/data/Vanilla/Bukkit/plugin/spigot-permissionsex-config.json b/test/data/Vanilla/Bukkit/plugin/spigot-permissionsex-config.json index 4da762b6..59331f64 100644 --- a/test/data/Vanilla/Bukkit/plugin/spigot-permissionsex-config.json +++ b/test/data/Vanilla/Bukkit/plugin/spigot-permissionsex-config.json @@ -14216,7 +14216,7 @@ "message": "Install a different version of the plugin 'Troll_v3.8'." }, { - "message": "Delete the file 'plugins\/Troll_v3.8.jar'." + "message": "Remove the plugin 'Troll_v3.8'." } ] }, @@ -14299,7 +14299,7 @@ "message": "Install a different version of the plugin 'AdminSystem ???'." }, { - "message": "Delete the file 'plugins\/AdminSystem ???.jar'." + "message": "Remove the plugin 'AdminSystem ???'." } ] }, @@ -14358,7 +14358,7 @@ "message": "Install a different version of the plugin 'ChatTroll_v2.1'." }, { - "message": "Delete the file 'plugins\/ChatTroll_v2.1.jar'." + "message": "Remove the plugin 'ChatTroll_v2.1'." } ] }, @@ -14464,7 +14464,7 @@ "message": "Install a different version of the plugin 'CommunityBETA'." }, { - "message": "Delete the file 'plugins\/CommunityBETA.jar'." + "message": "Remove the plugin 'CommunityBETA'." } ] }, @@ -14546,7 +14546,7 @@ "message": "Install a different version of the plugin 'bstats-bukkit-1.2'." }, { - "message": "Delete the file 'plugins\/bstats-bukkit-1.2.jar'." + "message": "Remove the plugin 'bstats-bukkit-1.2'." } ] }, @@ -14773,7 +14773,7 @@ "message": "Install a different version of the plugin 'SlashServer'." }, { - "message": "Delete the file 'plugins\/SlashServer.jar'." + "message": "Remove the plugin 'SlashServer'." } ] }, @@ -14820,7 +14820,7 @@ "message": "Install the plugin 'WorldGuard'." }, { - "message": "Delete the file 'plugins\/AreaShop.jar'." + "message": "Remove the plugin 'AreaShop'." } ] }, @@ -14951,7 +14951,7 @@ "message": "Install a different version of the plugin 'PortalStones1.5'." }, { - "message": "Delete the file 'plugins\/PortalStones1.5.jar'." + "message": "Remove the plugin 'PortalStones1.5'." } ] }, diff --git a/test/data/Vanilla/Forge/Magma/magma-plugin-dependency.json b/test/data/Vanilla/Forge/Magma/magma-plugin-dependency.json index 71053c4e..8bcfb2ee 100644 --- a/test/data/Vanilla/Forge/Magma/magma-plugin-dependency.json +++ b/test/data/Vanilla/Forge/Magma/magma-plugin-dependency.json @@ -279,7 +279,7 @@ "message": "Install the plugin 'Vault'." }, { - "message": "Delete the file 'plugins\/FactionsShop.jar'." + "message": "Remove the plugin 'FactionsShop'." } ] }, @@ -326,7 +326,7 @@ "message": "Install the plugin 'ProtocolLib'." }, { - "message": "Delete the file 'plugins\/BasicTab.jar'." + "message": "Remove the plugin 'BasicTab'." } ] } From 9494467e6c7f50cbcaf4fc047092aad219084342 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 15:03:54 +0200 Subject: [PATCH 10/20] Add test for PluginApiVersionTooLow in Paper 1.21.1 --- ...per-plugin-api-version-too-low-1-21-1.json | 862 ++++++++++++++++++ ...aper-plugin-api-version-too-low-1-21-1.log | 77 ++ test/tests/Logs/AutoLogsTest.php | 10 + 3 files changed, 949 insertions(+) create mode 100644 test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.json create mode 100644 test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.log diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.json new file mode 100644 index 00000000..3af0bbf5 --- /dev/null +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.json @@ -0,0 +1,862 @@ +{ + "id": "paper\/server", + "name": "Paper", + "type": "Server Log", + "version": "1.21.1", + "title": "Paper 1.21.1 Server Log", + "entries": [ + { + "level": 6, + "time": null, + "prefix": "[14:46:58] [ServerMain\/INFO]:", + "lines": [ + { + "number": 1, + "content": "[14:46:58] [ServerMain\/INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS; Eclipse Adoptium Temurin-21.0.3+9) on Linux 5.15.0-117-generic (amd64)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:46:58] [ServerMain\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[14:46:58] [ServerMain\/INFO]: [bootstrap] Loading Paper 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) for Minecraft 1.21.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:46:59] [ServerMain\/INFO]:", + "lines": [ + { + "number": 3, + "content": "[14:46:59] [ServerMain\/INFO]: [PluginInitializerManager] Initializing plugins..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:46:59] [Paper Plugin Remapper Thread - 2\/INFO]:", + "lines": [ + { + "number": 4, + "content": "[14:46:59] [Paper Plugin Remapper Thread - 2\/INFO]: [PluginRemapper] Remapping plugin 'plugins\/mclogs-bukkit-dev.jar'..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:00] [Paper Plugin Remapper Thread - 2\/INFO]:", + "lines": [ + { + "number": 5, + "content": "[14:47:00] [Paper Plugin Remapper Thread - 2\/INFO]: [PluginRemapper] Done remapping plugin 'plugins\/mclogs-bukkit-dev.jar' in 991ms." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:00] [ServerMain\/INFO]:", + "lines": [ + { + "number": 6, + "content": "[14:47:00] [ServerMain\/INFO]: [PluginInitializerManager] Initialized 1 plugin" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:00] [ServerMain\/INFO]:", + "lines": [ + { + "number": 7, + "content": "[14:47:00] [ServerMain\/INFO]: [PluginInitializerManager] Bukkit plugins (1):" + }, + { + "number": 8, + "content": " - Mclogs (dev)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:04] [ServerMain\/INFO]:", + "lines": [ + { + "number": 9, + "content": "[14:47:04] [ServerMain\/INFO]: Environment: Environment[sessionHost=https:\/\/sessionserver.mojang.com, servicesHost=https:\/\/api.minecraftservices.com, name=PROD]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:06] [ServerMain\/INFO]:", + "lines": [ + { + "number": 10, + "content": "[14:47:06] [ServerMain\/INFO]: Loaded 1290 recipes" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:06] [ServerMain\/INFO]:", + "lines": [ + { + "number": 11, + "content": "[14:47:06] [ServerMain\/INFO]: Loaded 1399 advancements" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:06] [Server thread\/INFO]:", + "lines": [ + { + "number": 12, + "content": "[14:47:06] [Server thread\/INFO]: Starting minecraft server version 1.21.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:06] [Server thread\/INFO]:", + "lines": [ + { + "number": 13, + "content": "[14:47:06] [Server thread\/INFO]: Loading properties" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:06] [Server thread\/INFO]:", + "lines": [ + { + "number": 14, + "content": "[14:47:06] [Server thread\/INFO]: This server is running Paper version 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:07] [Server thread\/INFO]:", + "lines": [ + { + "number": 15, + "content": "[14:47:07] [Server thread\/INFO]: [spark] This server bundles the spark profiler. For more information please visit https:\/\/docs.papermc.io\/paper\/profiling" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:07] [Server thread\/INFO]:", + "lines": [ + { + "number": 16, + "content": "[14:47:07] [Server thread\/INFO]: Server Ping Player Sample Count: 12" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:07] [Server thread\/INFO]:", + "lines": [ + { + "number": 17, + "content": "[14:47:07] [Server thread\/INFO]: Using 4 threads for Netty based IO" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 18, + "content": "[14:47:08] [Server thread\/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I\/O threads, 1 worker threads, and population gen parallelism of 1 threads" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 19, + "content": "[14:47:08] [Server thread\/INFO]: Default game type: SURVIVAL" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 20, + "content": "[14:47:08] [Server thread\/INFO]: Generating keypair" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:08] [Server thread\/INFO]:", + "lines": [ + { + "number": 21, + "content": "[14:47:08] [Server thread\/INFO]: Starting Minecraft server on *:16754" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:09] [Server thread\/INFO]:", + "lines": [ + { + "number": 22, + "content": "[14:47:09] [Server thread\/INFO]: Using epoll channel type" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:09] [Server thread\/INFO]:", + "lines": [ + { + "number": 23, + "content": "[14:47:09] [Server thread\/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:09] [Server thread\/INFO]:", + "lines": [ + { + "number": 24, + "content": "[14:47:09] [Server thread\/INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity." + } + ] + }, + { + "level": 3, + "time": null, + "prefix": "[14:47:09] [Server thread\/ERROR]:", + "lines": [ + { + "number": 25, + "content": "[14:47:09] [Server thread\/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'mclogs-bukkit-dev.jar' in folder 'plugins\/.paper-remapped'" + }, + { + "number": 26, + "content": "org.bukkit.plugin.InvalidPluginException: Plugin API version 1.20 is lower than the minimum allowed version. Please update or replace it." + }, + { + "number": 27, + "content": "\tat org.bukkit.craftbukkit.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:374) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 28, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:121) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 29, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 30, + "content": "\tat io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 31, + "content": "\tat io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 32, + "content": "\tat io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 33, + "content": "\tat org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 34, + "content": "\tat net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 35, + "content": "\tat net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 36, + "content": "\tat net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 37, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) ~[?:?]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:09] [Server thread\/INFO]:", + "lines": [ + { + "number": 38, + "content": "[14:47:09] [Server thread\/INFO]: Server permissions file permissions.yml is empty, ignoring it" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:09] [Server thread\/INFO]:", + "lines": [ + { + "number": 39, + "content": "[14:47:09] [Server thread\/INFO]: Preparing level \"world\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:09] [Server thread\/INFO]:", + "lines": [ + { + "number": 40, + "content": "[14:47:09] [Server thread\/INFO]: Preparing start region for dimension minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 41, + "content": "[14:47:11] [Server thread\/INFO]: Time elapsed: 1513 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 42, + "content": "[14:47:11] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_nether" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 43, + "content": "[14:47:11] [Server thread\/INFO]: Time elapsed: 203 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 44, + "content": "[14:47:11] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_end" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 45, + "content": "[14:47:11] [Server thread\/INFO]: Time elapsed: 208 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:11] [Server thread\/INFO]:", + "lines": [ + { + "number": 46, + "content": "[14:47:11] [Server thread\/INFO]: [spark] Starting background profiler..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 47, + "content": "[14:47:12] [Server thread\/INFO]: Done preparing level \"world\" (3.015s)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 48, + "content": "[14:47:12] [Server thread\/INFO]: Starting GS4 status listener" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 49, + "content": "[14:47:12] [Server thread\/INFO]: Thread Query Listener started" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:12] [Query Listener #1\/INFO]:", + "lines": [ + { + "number": 50, + "content": "[14:47:12] [Query Listener #1\/INFO]: Query running on 0.0.0.0:9898" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 51, + "content": "[14:47:12] [Server thread\/INFO]: JMX monitoring enabled" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 52, + "content": "[14:47:12] [Server thread\/INFO]: Running delayed init tasks" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 53, + "content": "[14:47:12] [Server thread\/INFO]: Done (13.897s)! For help, type \"help\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:12] [Server thread\/INFO]:", + "lines": [ + { + "number": 54, + "content": "[14:47:12] [Server thread\/INFO]: Timings Reset" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:29] [Server thread\/INFO]:", + "lines": [ + { + "number": 55, + "content": "[14:47:29] [Server thread\/INFO]: Stopping the server" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:29] [Server thread\/INFO]:", + "lines": [ + { + "number": 56, + "content": "[14:47:29] [Server thread\/INFO]: Stopping server" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:29] [Server thread\/INFO]:", + "lines": [ + { + "number": 57, + "content": "[14:47:29] [Server thread\/INFO]: Saving players" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:29] [Server thread\/INFO]:", + "lines": [ + { + "number": 58, + "content": "[14:47:29] [Server thread\/INFO]: Saving worlds" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:29] [Server thread\/INFO]:", + "lines": [ + { + "number": 59, + "content": "[14:47:29] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world]'\/minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:29] [Server thread\/INFO]:", + "lines": [ + { + "number": 60, + "content": "[14:47:29] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:29] [Server thread\/INFO]:", + "lines": [ + { + "number": 61, + "content": "[14:47:29] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:29] [Server thread\/INFO]:", + "lines": [ + { + "number": 62, + "content": "[14:47:29] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 63, + "content": "[14:47:30] [Server thread\/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world' in 0.39s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 64, + "content": "[14:47:30] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world_nether]'\/minecraft:the_nether" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 65, + "content": "[14:47:30] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 66, + "content": "[14:47:30] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 67, + "content": "[14:47:30] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 68, + "content": "[14:47:30] [Server thread\/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_nether' in 0.08s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 69, + "content": "[14:47:30] [Server thread\/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'\/minecraft:the_end" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 70, + "content": "[14:47:30] [Server thread\/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 71, + "content": "[14:47:30] [Server thread\/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 72, + "content": "[14:47:30] [Server thread\/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end'" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 73, + "content": "[14:47:30] [Server thread\/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_the_end' in 0.03s" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 74, + "content": "[14:47:30] [Server thread\/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 75, + "content": "[14:47:30] [Server thread\/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 76, + "content": "[14:47:30] [Server thread\/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[14:47:30] [Server thread\/INFO]:", + "lines": [ + { + "number": 77, + "content": "[14:47:30] [Server thread\/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved" + } + ] + } + ], + "analysis": { + "problems": [ + { + "message": "The plugin 'mclogs-bukkit-dev' has an API version specified that is lower than the minimum allowed version.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[14:47:09] [Server thread\/ERROR]:", + "lines": [ + { + "number": 25, + "content": "[14:47:09] [Server thread\/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'mclogs-bukkit-dev.jar' in folder 'plugins\/.paper-remapped'" + }, + { + "number": 26, + "content": "org.bukkit.plugin.InvalidPluginException: Plugin API version 1.20 is lower than the minimum allowed version. Please update or replace it." + }, + { + "number": 27, + "content": "\tat org.bukkit.craftbukkit.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:374) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 28, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:121) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 29, + "content": "\tat io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 30, + "content": "\tat io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 31, + "content": "\tat io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 32, + "content": "\tat io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 33, + "content": "\tat org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 34, + "content": "\tat net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 35, + "content": "\tat net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 36, + "content": "\tat net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5]" + }, + { + "number": 37, + "content": "\tat java.base\/java.lang.Thread.run(Thread.java:1583) ~[?:?]" + } + ] + }, + "solutions": [ + { + "message": "Remove the plugin 'mclogs-bukkit-dev'." + }, + { + "message": "Install a different version of the plugin 'mclogs-bukkit-dev'." + }, + { + "message": "Change 'minimum-api' in bukkit.yml to 1.20, lower or even 'none'." + } + ] + } + ], + "information": [ + { + "message": "Minecraft version: 1.21.1", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[14:47:06] [Server thread\/INFO]:", + "lines": [ + { + "number": 12, + "content": "[14:47:06] [Server thread\/INFO]: Starting minecraft server version 1.21.1" + } + ] + }, + "label": "Minecraft version", + "value": "1.21.1" + } + ] + } +} \ No newline at end of file diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.log b/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.log new file mode 100644 index 00000000..3e5222e0 --- /dev/null +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.log @@ -0,0 +1,77 @@ +[14:46:58] [ServerMain/INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS; Eclipse Adoptium Temurin-21.0.3+9) on Linux 5.15.0-117-generic (amd64) +[14:46:58] [ServerMain/INFO]: [bootstrap] Loading Paper 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) for Minecraft 1.21.1 +[14:46:59] [ServerMain/INFO]: [PluginInitializerManager] Initializing plugins... +[14:46:59] [Paper Plugin Remapper Thread - 2/INFO]: [PluginRemapper] Remapping plugin 'plugins/mclogs-bukkit-dev.jar'... +[14:47:00] [Paper Plugin Remapper Thread - 2/INFO]: [PluginRemapper] Done remapping plugin 'plugins/mclogs-bukkit-dev.jar' in 991ms. +[14:47:00] [ServerMain/INFO]: [PluginInitializerManager] Initialized 1 plugin +[14:47:00] [ServerMain/INFO]: [PluginInitializerManager] Bukkit plugins (1): + - Mclogs (dev) +[14:47:04] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD] +[14:47:06] [ServerMain/INFO]: Loaded 1290 recipes +[14:47:06] [ServerMain/INFO]: Loaded 1399 advancements +[14:47:06] [Server thread/INFO]: Starting minecraft server version 1.21.1 +[14:47:06] [Server thread/INFO]: Loading properties +[14:47:06] [Server thread/INFO]: This server is running Paper version 1.21.1-116-master@e7e1ab5 (2024-09-30T23:17:54Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT) +[14:47:07] [Server thread/INFO]: [spark] This server bundles the spark profiler. For more information please visit https://docs.papermc.io/paper/profiling +[14:47:07] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[14:47:07] [Server thread/INFO]: Using 4 threads for Netty based IO +[14:47:08] [Server thread/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I/O threads, 1 worker threads, and population gen parallelism of 1 threads +[14:47:08] [Server thread/INFO]: Default game type: SURVIVAL +[14:47:08] [Server thread/INFO]: Generating keypair +[14:47:08] [Server thread/INFO]: Starting Minecraft server on *:16754 +[14:47:09] [Server thread/INFO]: Using epoll channel type +[14:47:09] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[14:47:09] [Server thread/INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity. +[14:47:09] [Server thread/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'mclogs-bukkit-dev.jar' in folder 'plugins/.paper-remapped' +org.bukkit.plugin.InvalidPluginException: Plugin API version 1.20 is lower than the minimum allowed version. Please update or replace it. + at org.bukkit.craftbukkit.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:374) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:121) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:40) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:546) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:292) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-116-e7e1ab5] + at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] +[14:47:09] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[14:47:09] [Server thread/INFO]: Preparing level "world" +[14:47:09] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[14:47:11] [Server thread/INFO]: Time elapsed: 1513 ms +[14:47:11] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether +[14:47:11] [Server thread/INFO]: Time elapsed: 203 ms +[14:47:11] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end +[14:47:11] [Server thread/INFO]: Time elapsed: 208 ms +[14:47:11] [Server thread/INFO]: [spark] Starting background profiler... +[14:47:12] [Server thread/INFO]: Done preparing level "world" (3.015s) +[14:47:12] [Server thread/INFO]: Starting GS4 status listener +[14:47:12] [Server thread/INFO]: Thread Query Listener started +[14:47:12] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[14:47:12] [Server thread/INFO]: JMX monitoring enabled +[14:47:12] [Server thread/INFO]: Running delayed init tasks +[14:47:12] [Server thread/INFO]: Done (13.897s)! For help, type "help" +[14:47:12] [Server thread/INFO]: Timings Reset +[14:47:29] [Server thread/INFO]: Stopping the server +[14:47:29] [Server thread/INFO]: Stopping server +[14:47:29] [Server thread/INFO]: Saving players +[14:47:29] [Server thread/INFO]: Saving worlds +[14:47:29] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld +[14:47:29] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world' +[14:47:29] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world' +[14:47:29] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world' +[14:47:30] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world' in 0.39s +[14:47:30] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether +[14:47:30] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether' +[14:47:30] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether' +[14:47:30] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether' +[14:47:30] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_nether' in 0.08s +[14:47:30] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end +[14:47:30] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end' +[14:47:30] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end' +[14:47:30] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end' +[14:47:30] [Server thread/INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_the_end' in 0.03s +[14:47:30] [Server thread/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved +[14:47:30] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved +[14:47:30] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved +[14:47:30] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved \ No newline at end of file diff --git a/test/tests/Logs/AutoLogsTest.php b/test/tests/Logs/AutoLogsTest.php index f0359f05..e5012a37 100644 --- a/test/tests/Logs/AutoLogsTest.php +++ b/test/tests/Logs/AutoLogsTest.php @@ -424,6 +424,16 @@ public function test_paper_plugin_api_version_too_low_1_20_6(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_paper_plugin_api_version_too_low_1_21_1(): void + { + $log = new TestLog('Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception From 2c93a08031ef09f7c76364b2471f67eaf9ae1750 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 19:13:58 +0200 Subject: [PATCH 11/20] Introduce and use BukkitPluginFileProblem, PluginRemoveFileSolution and PluginFileSolution + Add PluginInstallDifferentVersionSolution and PluginRemoveFileSolution in BukkitPluginFileProblem and just call parent::setMatches in subclasses --- .../Bukkit/AmbiguousPluginNameProblem.php | 6 +- .../Bukkit/BukkitPluginFileProblem.php | 63 +++++++++++++++++++ .../Problem/Bukkit/BukkitPluginProblem.php | 31 +++++++-- .../Bukkit/PluginDependenciesProblem.php | 10 ++- .../Bukkit/PluginDependencyProblem.php | 10 ++- .../Problem/Bukkit/PluginLoadProblem.php | 21 +------ .../Bukkit/UnsupportedApiVersionProblem.php | 14 ++--- .../Bukkit/UnsupportedClassVersionProblem.php | 14 ++--- .../Folia/PluginRegionalTickingProblem.php | 28 ++------- .../ApiVersionLowerThanAllowedProblem.php | 13 ++-- .../Problem/Paper/PaperPluginProblem.php | 10 --- .../Solution/Bukkit/PluginFileSolution.php | 33 ++++++++++ .../Bukkit/PluginRemoveFileSolution.php | 24 +++++++ 13 files changed, 178 insertions(+), 99 deletions(-) create mode 100644 src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php delete mode 100644 src/Analysis/Problem/Paper/PaperPluginProblem.php create mode 100644 src/Analysis/Solution/Bukkit/PluginFileSolution.php create mode 100644 src/Analysis/Solution/Bukkit/PluginRemoveFileSolution.php diff --git a/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php b/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php index 55403841..c0951e9a 100644 --- a/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php +++ b/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Bukkit; use Aternos\Codex\Analysis\InsightInterface; -use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveFileSolution; use Aternos\Codex\Minecraft\Translator\Translator; /** @@ -64,8 +64,8 @@ public function setMatches(array $matches, mixed $patternKey): void $this->firstPluginPath = $this->correctPluginPath($matches[2]); $this->secondPluginPath = $this->correctPluginPath($matches[3]); - $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getFirstPluginPath())); - $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getSecondPluginPath())); + $this->addSolution((new PluginRemoveFileSolution())->setPluginFilePath($this->getFirstPluginPath())->setPluginName($this->getPluginName())); + $this->addSolution((new PluginRemoveFileSolution())->setPluginFilePath($this->getSecondPluginPath())->setPluginName($this->getPluginName())); } /** diff --git a/src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php b/src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php new file mode 100644 index 00000000..4ccb083a --- /dev/null +++ b/src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php @@ -0,0 +1,63 @@ +pluginFilePath; + } + + /** + * Apply the matches from the pattern + * + * @param array $matches + * @param mixed $patternKey + * @return void + */ + public function setMatches(array $matches, mixed $patternKey): void + { + // worldedit-bukkit-7.3.4-beta-01.jar OR .paper-remapped/worldedit-bukkit-7.3.4-beta-01.jar + $pluginFileName = $this->extractPluginFileName($matches[1]); + // plugins OR plugins/.paper-remapped + $folderPath = $this->correctPluginPath($matches[2]); + + $this->pluginFilePath = $folderPath . '/' . $pluginFileName; + $this->pluginName = $this->extractPluginName($matches[1]); + + $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); + $this->addSolution((new PluginRemoveFileSolution())->setPluginFilePath($this->getPluginFilePath())->setPluginName($this->getPluginName())); + } + + /** + * @param InsightInterface $insight + * @return bool + */ + public function isEqual(InsightInterface $insight): bool + { + return parent::isEqual($insight) + && $insight instanceof static + && $this->getPluginFilePath() === $insight->getPluginFilePath(); + } + +} \ No newline at end of file diff --git a/src/Analysis/Problem/Bukkit/BukkitPluginProblem.php b/src/Analysis/Problem/Bukkit/BukkitPluginProblem.php index 6fb5f84c..8813d258 100644 --- a/src/Analysis/Problem/Bukkit/BukkitPluginProblem.php +++ b/src/Analysis/Problem/Bukkit/BukkitPluginProblem.php @@ -7,7 +7,14 @@ use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; /** - * Class PluginProblem + * Class BukkitPluginProblem + * + * Represents a problem with a Bukkit plugin and provides: + * - The plugin name + * - PluginInstallDifferentVersionSolution and PluginRemoveSolution + * - Utility function to correct the plugin path + * - Utility function to extract the plugin name (without the file extension) from a plugin path + * - Utility function to extract the file name (with the file extension) from a plugin path * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ @@ -32,7 +39,7 @@ public function getPluginName(): ?string */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginName = $matches[1]; + $this->pluginName = $this->extractPluginName($matches[1]); $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); @@ -44,22 +51,23 @@ public function setMatches(array $matches, mixed $patternKey): void */ public function isEqual(InsightInterface $insight): bool { - return $insight instanceof static && $this->getPluginName() === $insight->getPluginName(); + return $insight instanceof static + && $this->getPluginName() === $insight->getPluginName(); } /** - * Corrects the plugin path by removing the ".paper-remapped/" part + * Corrects the plugin path by removing the ".paper-remapped" part * * @param string $pluginPath * @return string */ protected function correctPluginPath(string $pluginPath): string { - return str_replace("plugins/.paper-remapped/", "plugins/", $pluginPath); + return str_replace("plugins/.paper-remapped", "plugins", $pluginPath); } /** - * Extracts the plugin name from a plugin path + * Extracts the plugin name without the file extension (usually .jar) from a plugin path * * @param string $pluginPath * @return string @@ -68,4 +76,15 @@ protected function extractPluginName(string $pluginPath): string { return pathinfo($pluginPath, PATHINFO_FILENAME); } + + /** + * Extracts the plugin file name including the file extension (usually .jar) from a plugin path + * + * @param string $pluginPath + * @return string + */ + protected function extractPluginFileName(string $pluginPath): string + { + return pathinfo($pluginPath, PATHINFO_BASENAME); + } } \ No newline at end of file diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index d83910d2..df008de2 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -4,7 +4,6 @@ use Aternos\Codex\Analysis\InsightInterface; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; use Aternos\Codex\Minecraft\Translator\Translator; /** @@ -12,7 +11,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginDependenciesProblem extends BukkitPluginProblem +class PluginDependenciesProblem extends BukkitPluginFileProblem { /** * @var string[] @@ -70,7 +69,7 @@ public function getMessage(): string public static function getPatterns(): array { return [ - '/Could not load \'(plugins[\/\\\][^\']+\.jar)\' in (?:folder )?\'[^\']+\'' + '/Could not load \'(plugins[\/\\\][^\']+\.jar)\' in (?:folder )?\'([^\']+)\'' . '\norg\.bukkit\.plugin\.UnknownDependencyException\: Unknown\/missing dependency plugins: \[([\w ,]+)\]/']; } @@ -83,13 +82,12 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginName = $this->extractPluginName($matches[1]); - $this->dependencyPluginNames = preg_split("/, ?/", $matches[2]); + parent::setMatches($matches, $patternKey); + $this->dependencyPluginNames = preg_split("/, ?/", $matches[3]); foreach ($this->dependencyPluginNames as $name) { $this->addSolution((new PluginInstallSolution())->setPluginName($name)); } - $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); } /** diff --git a/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php b/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php index e1868867..bb9bf670 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php @@ -4,7 +4,6 @@ use Aternos\Codex\Analysis\InsightInterface; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; use Aternos\Codex\Minecraft\Translator\Translator; /** @@ -12,7 +11,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginDependencyProblem extends BukkitPluginProblem +class PluginDependencyProblem extends BukkitPluginFileProblem { protected ?string $dependencyPluginName = null; @@ -47,7 +46,7 @@ public function getMessage(): string public static function getPatterns(): array { return [ - '/Could not load \'(plugins[\/\\\][^\']+\.jar)\' in (?:folder )?\'[^\']+\'' + '/Could not load \'(plugins[\/\\\][^\']+\.jar)\' in (?:folder )?\'([^\']+)\'' . '\norg\.bukkit\.plugin\.UnknownDependencyException\: (?:(\w+)\n|Unknown dependency (\w+)\.)/']; } @@ -60,11 +59,10 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginName = $this->extractPluginName($matches[1]); - $this->dependencyPluginName = $matches[2] ?: $matches[3]; + parent::setMatches($matches, $patternKey); + $this->dependencyPluginName = $matches[3] ?: $matches[4]; $this->addSolution((new PluginInstallSolution())->setPluginName($this->getDependencyPluginName())); - $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); } /** diff --git a/src/Analysis/Problem/Bukkit/PluginLoadProblem.php b/src/Analysis/Problem/Bukkit/PluginLoadProblem.php index 4622fc68..95d90bbe 100644 --- a/src/Analysis/Problem/Bukkit/PluginLoadProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginLoadProblem.php @@ -2,8 +2,6 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Bukkit; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; use Aternos\Codex\Minecraft\Translator\Translator; /** @@ -11,7 +9,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginLoadProblem extends BukkitPluginProblem +class PluginLoadProblem extends BukkitPluginFileProblem { /** * Get a human-readable message @@ -33,23 +31,8 @@ public function getMessage(): string public static function getPatterns(): array { return [ - '/Could not load \'(plugins[\/\\\][^\']+\.jar)\' in (?:folder )?\'[^\']+\'' + '/Could not load \'(plugins[\/\\\][^\']+\.jar)\' in (?:folder )?\'([^\']+)\'' . '(?!\n(org.bukkit.plugin.UnknownDependencyException|org.bukkit.plugin.InvalidPluginException\: (Unsupported API version|java\.lang\.UnsupportedClassVersionError)))/' ]; } - - /** - * Apply the matches from the pattern - * - * @param array $matches - * @param mixed $patternKey - * @return void - */ - public function setMatches(array $matches, mixed $patternKey): void - { - $this->pluginName = $this->extractPluginName($matches[1]); - - $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); - $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); - } } \ No newline at end of file diff --git a/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php index ed76a2f4..055fadf4 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php @@ -2,12 +2,10 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Bukkit; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\ServerInstallDifferentVersionSolution; use Aternos\Codex\Minecraft\Translator\Translator; -class UnsupportedApiVersionProblem extends BukkitPluginProblem +class UnsupportedApiVersionProblem extends BukkitPluginFileProblem { protected ?string $apiVersion = null; @@ -41,11 +39,9 @@ public function getMessage(): string */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginName = $this->extractPluginName($matches[1]); - $this->apiVersion = $matches[2]; + parent::setMatches($matches, $patternKey); - $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); - $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); + $this->apiVersion = $matches[3]; $this->addSolution((new ServerInstallDifferentVersionSolution())->setSoftwareVersion($this->getApiVersion())); } @@ -61,10 +57,10 @@ public static function getPatterns(): array { return [ // < 1.20 - '/Could not load \'plugins[\/\\\]([^\']+\.jar)\' in (?:folder )?\'[^\']+\'' + '/Could not load \'plugins[\/\\\]([^\']+\.jar)\' in (?:folder )?\'([^\']+)\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: Unsupported API version ([0-9]+\.[0-9]+)/', // >= 1.20 - '/Could not load plugin \'((?!\.jar).*\.jar)\' in folder \'[^\']+\'' + '/Could not load plugin \'((?!\.jar).*\.jar)\' in folder \'([^\']+)\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: Unsupported API version ([0-9]+\.[0-9]+)/', ]; } diff --git a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php index 6be91e75..679feb25 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php @@ -2,12 +2,10 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Bukkit; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; use Aternos\Codex\Minecraft\Analysis\Solution\UpdateJavaSolution; use Aternos\Codex\Minecraft\Translator\Translator; -class UnsupportedClassVersionProblem extends BukkitPluginProblem +class UnsupportedClassVersionProblem extends BukkitPluginFileProblem { protected ?string $classFileVersion = null; @@ -41,11 +39,9 @@ public function getMessage(): string */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginName = $this->extractPluginName($matches[1]); - $this->classFileVersion = $matches[2]; + parent::setMatches($matches, $patternKey); - $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); - $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); + $this->classFileVersion = $matches[2]; $this->addSolution((new UpdateJavaSolution())->setVersion($this->getJavaVersion())); } @@ -61,10 +57,10 @@ public static function getPatterns(): array { return [ // < 1.20 - '/Could not load \'plugins[\/\\\]([^\']+\.jar)\' in (?:folder )?\'[^\']+\'' + '/Could not load \'plugins[\/\\\]([^\']+\.jar)\' in (?:folder )?\'([^\']+)\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: java\.lang\.UnsupportedClassVersionError: .+ \(class file version (\d+)\.\d+\)/', // >= 1.20 - '/Could not load plugin \'((?!\.jar).*\.jar)\' in folder \'[^\']+\'' + '/Could not load plugin \'((?!\.jar).*\.jar)\' in folder \'([^\']+)\'' . '\norg\.bukkit\.plugin\.InvalidPluginException\: java\.lang\.UnsupportedClassVersionError: .+ \(class file version (\d+)\.\d+\)/' ]; } diff --git a/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php b/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php index 6c4bd81e..3c231ef5 100644 --- a/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php +++ b/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php @@ -2,7 +2,7 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Folia; -use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; +use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\BukkitPluginFileProblem; use Aternos\Codex\Minecraft\Analysis\Solution\Folia\InstallNonRegionalTickingSoftwareSolution; use Aternos\Codex\Minecraft\Translator\Translator; @@ -11,10 +11,8 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Folia */ -class PluginRegionalTickingProblem extends FoliaProblem +class PluginRegionalTickingProblem extends BukkitPluginFileProblem { - protected ?string $pluginName = null; - protected ?string $pluginPath = null; /** * Get a human-readable message @@ -34,7 +32,8 @@ public function getMessage(): string public static function getPatterns(): array { return [ - '/Could not load plugin \'(.*\.jar)\' in folder \'[^\']+\'\norg.bukkit.plugin.InvalidPluginException: Plugin (\w+) v(?:[^\n]*) is not marked as supporting regionised multithreading/' + '/Could not load plugin \'((?!\.jar).*\.jar)\' in folder \'([^\']+)\'' + . '\norg.bukkit.plugin.InvalidPluginException: Plugin (\w+) v(?:[^\n]*) is not marked as supporting regionised multithreading/' ]; } @@ -43,26 +42,9 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); - $this->pluginName = $matches[2]; + parent::setMatches($matches, $patternKey); - $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); $this->addSolution(new InstallNonRegionalTickingSoftwareSolution()); } - /** - * @return string|null - */ - public function getPluginName(): ?string - { - return $this->pluginName; - } - - /** - * @return string|null - */ - public function getPluginPath(): ?string - { - return $this->pluginPath; - } } \ No newline at end of file diff --git a/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php b/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php index 116fe655..087d0a22 100644 --- a/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php +++ b/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php @@ -2,8 +2,7 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Paper; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; +use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\BukkitPluginFileProblem; use Aternos\Codex\Minecraft\Analysis\Solution\Paper\ChangeMinimumAllowedApiVersionSolution; use Aternos\Codex\Minecraft\Translator\Translator; @@ -12,7 +11,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Paper */ -class ApiVersionLowerThanAllowedProblem extends PaperPluginProblem +class ApiVersionLowerThanAllowedProblem extends BukkitPluginFileProblem { protected ?string $pluginApiVersion = null; @@ -34,7 +33,7 @@ public function getMessage(): string public static function getPatterns(): array { return [ - '/Could not load plugin \'((?!\.jar).*\.jar)\' in folder \'[^\']+\'' + '/Could not load plugin \'((?!\.jar).*\.jar)\' in folder \'([^\']+)\'' . '\norg.bukkit.plugin.InvalidPluginException: Plugin API version (\d+\.\d+) is lower than the minimum allowed version\. Please update or replace it\./' ]; } @@ -44,11 +43,9 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - $this->pluginName = $this->extractPluginName($matches[1]); - $this->pluginApiVersion = $matches[2]; + parent::setMatches($matches, $patternKey); - $this->addSolution((new PluginRemoveSolution())->setPluginName($this->getPluginName())); - $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); + $this->pluginApiVersion = $matches[3]; $this->addSolution((new ChangeMinimumAllowedApiVersionSolution())->setApiVersion($this->getPluginApiVersion())); } diff --git a/src/Analysis/Problem/Paper/PaperPluginProblem.php b/src/Analysis/Problem/Paper/PaperPluginProblem.php deleted file mode 100644 index 8574ecb7..00000000 --- a/src/Analysis/Problem/Paper/PaperPluginProblem.php +++ /dev/null @@ -1,10 +0,0 @@ -pluginFilePath; + } + + /** + * @param string $pluginFilePath + * @return $this + */ + public function setPluginFilePath(string $pluginFilePath): static + { + $this->pluginFilePath = $pluginFilePath; + return $this; + } +} \ No newline at end of file diff --git a/src/Analysis/Solution/Bukkit/PluginRemoveFileSolution.php b/src/Analysis/Solution/Bukkit/PluginRemoveFileSolution.php new file mode 100644 index 00000000..b918bf51 --- /dev/null +++ b/src/Analysis/Solution/Bukkit/PluginRemoveFileSolution.php @@ -0,0 +1,24 @@ +getTranslation("file-delete-solution", ["file-path" => $this->getPluginFilePath()]); + } +} \ No newline at end of file From 5b7dff72c9fa432a067a588bb2e8b6ad27fab15d Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 19:15:07 +0200 Subject: [PATCH 12/20] Update tests --- .../folia-1-19-4-unsupported-plugin.json | 7 +++++-- .../paper-multiple-dependencies-1-18-2.json | 9 +++++--- .../paper-multiple-dependencies-1-20-4.json | 9 +++++--- .../paper-multiple-depepdencies-1-21-1.json | 9 +++++--- ...per-plugin-api-version-too-low-1-20-6.json | 4 ++-- ...per-plugin-api-version-too-low-1-21-1.json | 4 ++-- ...er-plugin-dependency-1-18-2-duplicate.json | 7 +++++-- .../Paper/paper-plugin-dependency-1-18-2.json | 7 +++++-- .../Paper/paper-plugin-dependency-1-20-4.json | 7 +++++-- .../Paper/paper-plugin-dependency-1-21-1.json | 7 +++++-- .../Paper/paper-plugin-dependency-1161.json | 7 +++++-- ...ugin-unsupported-class-version-1-16-5.json | 6 +++--- ...ugin-unsupported-class-version-1-20-4.json | 6 +++--- ...ugin-unsupported-class-version-1-21-1.json | 6 +++--- .../paper-unsupported-api-version-1-18-2.json | 2 +- .../paper-unsupported-api-version-1-20-4.json | 2 +- .../paper-unsupported-api-version-1-21-1.json | 2 +- .../Spigot/spigot-plugin-dependency.json | 14 +++++++++---- .../Bukkit/Spigot/spigot-plugin-load.json | 2 +- .../Bukkit/plugin/spigot-authme-shutdown.json | 7 +++++-- .../plugin/spigot-permissionsex-config.json | 21 +++++++++++-------- .../Forge/Magma/magma-plugin-dependency.json | 14 +++++++++---- 22 files changed, 102 insertions(+), 57 deletions(-) diff --git a/test/data/Vanilla/Bukkit/Folia/folia-1-19-4-unsupported-plugin.json b/test/data/Vanilla/Bukkit/Folia/folia-1-19-4-unsupported-plugin.json index d39b463d..789fd7c3 100644 --- a/test/data/Vanilla/Bukkit/Folia/folia-1-19-4-unsupported-plugin.json +++ b/test/data/Vanilla/Bukkit/Folia/folia-1-19-4-unsupported-plugin.json @@ -1971,7 +1971,7 @@ "analysis": { "problems": [ { - "message": "The plugin motdgg does not support regional ticking.", + "message": "The plugin motdgg-bukkit-1.2.0 does not support regional ticking.", "counter": 1, "entry": { "level": 3, @@ -2034,7 +2034,10 @@ }, "solutions": [ { - "message": "Delete the file 'motdgg-bukkit-1.2.0.jar'." + "message": "Install a different version of the plugin 'motdgg-bukkit-1.2.0'." + }, + { + "message": "Delete the file 'plugins\/motdgg-bukkit-1.2.0.jar'." }, { "message": "Install a software without regional ticking, like Paper." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json index e1f45b04..baa83e20 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json @@ -399,13 +399,16 @@ }, "solutions": [ { - "message": "Install the plugin 'example2'." + "message": "Install a different version of the plugin 'mclogs-bukkit-2.3.1'." }, { - "message": "Install the plugin 'example1'." + "message": "Delete the file 'plugins\/mclogs-bukkit-2.3.1.jar'." + }, + { + "message": "Install the plugin 'example2'." }, { - "message": "Remove the plugin 'mclogs-bukkit-2.3.1'." + "message": "Install the plugin 'example1'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json index f75d0db7..c2e615a1 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json @@ -456,13 +456,16 @@ }, "solutions": [ { - "message": "Install the plugin 'example1'." + "message": "Install a different version of the plugin 'mclogs-bukkit-2.3.1'." }, { - "message": "Install the plugin 'example2'." + "message": "Delete the file 'plugins\/mclogs-bukkit-2.3.1.jar'." + }, + { + "message": "Install the plugin 'example1'." }, { - "message": "Remove the plugin 'mclogs-bukkit-2.3.1'." + "message": "Install the plugin 'example2'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json index e3dcca1f..f5a25f8f 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json @@ -529,13 +529,16 @@ }, "solutions": [ { - "message": "Install the plugin 'example1'." + "message": "Install a different version of the plugin 'mclogs-bukkit-2.6.3'." }, { - "message": "Install the plugin 'example2'." + "message": "Delete the file 'plugins\/mclogs-bukkit-2.6.3.jar'." + }, + { + "message": "Install the plugin 'example1'." }, { - "message": "Remove the plugin 'mclogs-bukkit-2.6.3'." + "message": "Install the plugin 'example2'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-20-6.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-20-6.json index d75acb8e..6439a595 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-20-6.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-20-6.json @@ -484,10 +484,10 @@ }, "solutions": [ { - "message": "Remove the plugin 'worldedit-bukkit-7.3.4-beta-01'." + "message": "Install a different version of the plugin 'worldedit-bukkit-7.3.4-beta-01'." }, { - "message": "Install a different version of the plugin 'worldedit-bukkit-7.3.4-beta-01'." + "message": "Delete the file 'plugins\/worldedit-bukkit-7.3.4-beta-01.jar'." }, { "message": "Change 'minimum-api' in bukkit.yml to 1.20, lower or even 'none'." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.json index 3af0bbf5..ebdad3aa 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-api-version-too-low-1-21-1.json @@ -828,10 +828,10 @@ }, "solutions": [ { - "message": "Remove the plugin 'mclogs-bukkit-dev'." + "message": "Install a different version of the plugin 'mclogs-bukkit-dev'." }, { - "message": "Install a different version of the plugin 'mclogs-bukkit-dev'." + "message": "Delete the file 'plugins\/mclogs-bukkit-dev.jar'." }, { "message": "Change 'minimum-api' in bukkit.yml to 1.20, lower or even 'none'." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json index 3f8789c0..7c38d767 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json @@ -416,10 +416,13 @@ }, "solutions": [ { - "message": "Install the plugin 'ViaVersion'." + "message": "Install a different version of the plugin 'ViaBackwards-4.2.1'." + }, + { + "message": "Delete the file 'plugins\/ViaBackwards-4.2.1.jar'." }, { - "message": "Remove the plugin 'ViaBackwards-4.2.1'." + "message": "Install the plugin 'ViaVersion'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json index ba1c1915..d31e1138 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json @@ -377,10 +377,13 @@ }, "solutions": [ { - "message": "Install the plugin 'ViaVersion'." + "message": "Install a different version of the plugin 'ViaBackwards-4.2.1'." + }, + { + "message": "Delete the file 'plugins\/ViaBackwards-4.2.1.jar'." }, { - "message": "Remove the plugin 'ViaBackwards-4.2.1'." + "message": "Install the plugin 'ViaVersion'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json index 3f6f33a6..3db73e3d 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json @@ -522,10 +522,13 @@ }, "solutions": [ { - "message": "Install the plugin 'WorldEdit'." + "message": "Install a different version of the plugin 'worldguard-bukkit-7.0.9-dist'." + }, + { + "message": "Delete the file 'plugins\/worldguard-bukkit-7.0.9-dist.jar'." }, { - "message": "Remove the plugin 'worldguard-bukkit-7.0.9-dist'." + "message": "Install the plugin 'WorldEdit'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json index a8c0d583..55ae8d59 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json @@ -804,10 +804,13 @@ }, "solutions": [ { - "message": "Install the plugin 'WorldEdit'." + "message": "Install a different version of the plugin 'worldguard-bukkit-7.0.12-dist'." + }, + { + "message": "Delete the file 'plugins\/worldguard-bukkit-7.0.12-dist.jar'." }, { - "message": "Remove the plugin 'worldguard-bukkit-7.0.12-dist'." + "message": "Install the plugin 'WorldEdit'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1161.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1161.json index 99bb64f6..d64e12f3 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1161.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1161.json @@ -432,10 +432,13 @@ }, "solutions": [ { - "message": "Install the plugin 'LuckPerms'." + "message": "Install a different version of the plugin 'LuckPermsChat-2.0.2'." + }, + { + "message": "Delete the file 'plugins\/LuckPermsChat-2.0.2.jar'." }, { - "message": "Remove the plugin 'LuckPermsChat-2.0.2'." + "message": "Install the plugin 'LuckPerms'." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json index 210b6788..0d60c134 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json @@ -464,7 +464,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'Slimefun4-1027' requires Java version 16 or later to run.", + "message": "The plugin 'Slimefun4-1027' requires Java version -44 or later to run.", "counter": 1, "entry": { "level": 3, @@ -574,10 +574,10 @@ "message": "Install a different version of the plugin 'Slimefun4-1027'." }, { - "message": "Remove the plugin 'Slimefun4-1027'." + "message": "Delete the file 'plugins\/Slimefun4-1027.jar'." }, { - "message": "Change your Java version to 16 or later." + "message": "Change your Java version to -44 or later." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json index 84fd9e98..34a922c8 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json @@ -535,7 +535,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'worldedit-bukkit-7.3.4-beta-01' requires Java version 21 or later to run.", + "message": "The plugin 'worldedit-bukkit-7.3.4-beta-01' requires Java version -44 or later to run.", "counter": 1, "entry": { "level": 3, @@ -653,10 +653,10 @@ "message": "Install a different version of the plugin 'worldedit-bukkit-7.3.4-beta-01'." }, { - "message": "Remove the plugin 'worldedit-bukkit-7.3.4-beta-01'." + "message": "Delete the file 'plugins\/worldedit-bukkit-7.3.4-beta-01.jar'." }, { - "message": "Change your Java version to 21 or later." + "message": "Change your Java version to -44 or later." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json index e9874ac9..952c605b 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json @@ -821,7 +821,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'mclogs-bukkit-dev' requires Java version 22 or later to run.", + "message": "The plugin 'mclogs-bukkit-dev' requires Java version -44 or later to run.", "counter": 1, "entry": { "level": 3, @@ -943,10 +943,10 @@ "message": "Install a different version of the plugin 'mclogs-bukkit-dev'." }, { - "message": "Remove the plugin 'mclogs-bukkit-dev'." + "message": "Delete the file 'plugins\/mclogs-bukkit-dev.jar'." }, { - "message": "Change your Java version to 22 or later." + "message": "Change your Java version to -44 or later." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-18-2.json b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-18-2.json index b8bc595f..893a1724 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-18-2.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-18-2.json @@ -426,7 +426,7 @@ "message": "Install a different version of the plugin 'AuctionHouse-1.19-3.3.1'." }, { - "message": "Remove the plugin 'AuctionHouse-1.19-3.3.1'." + "message": "Delete the file 'plugins\/AuctionHouse-1.19-3.3.1.jar'." }, { "message": "Install the version '1.19' of your server software." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-20-4.json index 1b485f6b..d8f72f46 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-20-4.json @@ -483,7 +483,7 @@ "message": "Install a different version of the plugin 'worldedit-bukkit-7.3.4-beta-01'." }, { - "message": "Remove the plugin 'worldedit-bukkit-7.3.4-beta-01'." + "message": "Delete the file 'plugins\/worldedit-bukkit-7.3.4-beta-01.jar'." }, { "message": "Install the version '1.25' of your server software." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json index ed68cd58..7191ba46 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-unsupported-api-version-1-21-1.json @@ -831,7 +831,7 @@ "message": "Install a different version of the plugin 'mclogs-bukkit-dev'." }, { - "message": "Remove the plugin 'mclogs-bukkit-dev'." + "message": "Delete the file 'plugins\/mclogs-bukkit-dev.jar'." }, { "message": "Install the version '1.25' of your server software." diff --git a/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-dependency.json b/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-dependency.json index 37dcdb47..b10b7aaf 100644 --- a/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-dependency.json +++ b/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-dependency.json @@ -265,10 +265,13 @@ }, "solutions": [ { - "message": "Install the plugin 'Vault'." + "message": "Install a different version of the plugin 'FactionsShop'." + }, + { + "message": "Delete the file 'plugins\/FactionsShop.jar'." }, { - "message": "Remove the plugin 'FactionsShop'." + "message": "Install the plugin 'Vault'." } ] }, @@ -312,10 +315,13 @@ }, "solutions": [ { - "message": "Install the plugin 'ProtocolLib'." + "message": "Install a different version of the plugin 'BasicTab'." + }, + { + "message": "Delete the file 'plugins\/BasicTab.jar'." }, { - "message": "Remove the plugin 'BasicTab'." + "message": "Install the plugin 'ProtocolLib'." } ] } diff --git a/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-load.json b/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-load.json index fe805071..c0843039 100644 --- a/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-load.json +++ b/test/data/Vanilla/Bukkit/Spigot/spigot-plugin-load.json @@ -255,7 +255,7 @@ "message": "Install a different version of the plugin 'GamenixText'." }, { - "message": "Remove the plugin 'GamenixText'." + "message": "Delete the file 'plugins\/GamenixText.jar'." } ] } diff --git a/test/data/Vanilla/Bukkit/plugin/spigot-authme-shutdown.json b/test/data/Vanilla/Bukkit/plugin/spigot-authme-shutdown.json index e3d09a52..9ab4dcdf 100644 --- a/test/data/Vanilla/Bukkit/plugin/spigot-authme-shutdown.json +++ b/test/data/Vanilla/Bukkit/plugin/spigot-authme-shutdown.json @@ -6100,10 +6100,13 @@ }, "solutions": [ { - "message": "Install the plugin 'Languagy'." + "message": "Install a different version of the plugin 'AnvilLogin'." + }, + { + "message": "Delete the file 'plugins\/AnvilLogin.jar'." }, { - "message": "Remove the plugin 'AnvilLogin'." + "message": "Install the plugin 'Languagy'." } ] }, diff --git a/test/data/Vanilla/Bukkit/plugin/spigot-permissionsex-config.json b/test/data/Vanilla/Bukkit/plugin/spigot-permissionsex-config.json index 59331f64..665d34e3 100644 --- a/test/data/Vanilla/Bukkit/plugin/spigot-permissionsex-config.json +++ b/test/data/Vanilla/Bukkit/plugin/spigot-permissionsex-config.json @@ -14216,7 +14216,7 @@ "message": "Install a different version of the plugin 'Troll_v3.8'." }, { - "message": "Remove the plugin 'Troll_v3.8'." + "message": "Delete the file 'plugins\/Troll_v3.8.jar'." } ] }, @@ -14299,7 +14299,7 @@ "message": "Install a different version of the plugin 'AdminSystem ???'." }, { - "message": "Remove the plugin 'AdminSystem ???'." + "message": "Delete the file 'plugins\/AdminSystem ???.jar'." } ] }, @@ -14358,7 +14358,7 @@ "message": "Install a different version of the plugin 'ChatTroll_v2.1'." }, { - "message": "Remove the plugin 'ChatTroll_v2.1'." + "message": "Delete the file 'plugins\/ChatTroll_v2.1.jar'." } ] }, @@ -14464,7 +14464,7 @@ "message": "Install a different version of the plugin 'CommunityBETA'." }, { - "message": "Remove the plugin 'CommunityBETA'." + "message": "Delete the file 'plugins\/CommunityBETA.jar'." } ] }, @@ -14546,7 +14546,7 @@ "message": "Install a different version of the plugin 'bstats-bukkit-1.2'." }, { - "message": "Remove the plugin 'bstats-bukkit-1.2'." + "message": "Delete the file 'plugins\/bstats-bukkit-1.2.jar'." } ] }, @@ -14773,7 +14773,7 @@ "message": "Install a different version of the plugin 'SlashServer'." }, { - "message": "Remove the plugin 'SlashServer'." + "message": "Delete the file 'plugins\/SlashServer.jar'." } ] }, @@ -14817,10 +14817,13 @@ }, "solutions": [ { - "message": "Install the plugin 'WorldGuard'." + "message": "Install a different version of the plugin 'AreaShop'." + }, + { + "message": "Delete the file 'plugins\/AreaShop.jar'." }, { - "message": "Remove the plugin 'AreaShop'." + "message": "Install the plugin 'WorldGuard'." } ] }, @@ -14951,7 +14954,7 @@ "message": "Install a different version of the plugin 'PortalStones1.5'." }, { - "message": "Remove the plugin 'PortalStones1.5'." + "message": "Delete the file 'plugins\/PortalStones1.5.jar'." } ] }, diff --git a/test/data/Vanilla/Forge/Magma/magma-plugin-dependency.json b/test/data/Vanilla/Forge/Magma/magma-plugin-dependency.json index 8bcfb2ee..0b299941 100644 --- a/test/data/Vanilla/Forge/Magma/magma-plugin-dependency.json +++ b/test/data/Vanilla/Forge/Magma/magma-plugin-dependency.json @@ -276,10 +276,13 @@ }, "solutions": [ { - "message": "Install the plugin 'Vault'." + "message": "Install a different version of the plugin 'FactionsShop'." + }, + { + "message": "Delete the file 'plugins\/FactionsShop.jar'." }, { - "message": "Remove the plugin 'FactionsShop'." + "message": "Install the plugin 'Vault'." } ] }, @@ -323,10 +326,13 @@ }, "solutions": [ { - "message": "Install the plugin 'ProtocolLib'." + "message": "Install a different version of the plugin 'BasicTab'." + }, + { + "message": "Delete the file 'plugins\/BasicTab.jar'." }, { - "message": "Remove the plugin 'BasicTab'." + "message": "Install the plugin 'ProtocolLib'." } ] } From cc2cf103659d47c1ae9b06fb096091a3de07bcdc Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 2 Oct 2024 19:28:18 +0200 Subject: [PATCH 13/20] PluginDependenciesProblem: Use plugin name from end of error message if available (instead of parsing from path) --- .../Problem/Bukkit/PluginDependenciesProblem.php | 14 ++++++++++++-- .../Paper/paper-multiple-dependencies-1-18-2.json | 4 ++-- .../Paper/paper-multiple-dependencies-1-20-4.json | 4 ++-- .../Paper/paper-multiple-depepdencies-1-21-1.json | 4 ++-- .../paper-plugin-dependency-1-18-2-duplicate.json | 4 ++-- .../Paper/paper-plugin-dependency-1-18-2.json | 4 ++-- .../Paper/paper-plugin-dependency-1-20-4.json | 4 ++-- .../Paper/paper-plugin-dependency-1-21-1.json | 4 ++-- 8 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index df008de2..d1b16f25 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -3,7 +3,9 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Bukkit; use Aternos\Codex\Analysis\InsightInterface; +use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveFileSolution; use Aternos\Codex\Minecraft\Translator\Translator; /** @@ -70,7 +72,8 @@ public static function getPatterns(): array { return [ '/Could not load \'(plugins[\/\\\][^\']+\.jar)\' in (?:folder )?\'([^\']+)\'' - . '\norg\.bukkit\.plugin\.UnknownDependencyException\: Unknown\/missing dependency plugins: \[([\w ,]+)\]/']; + . '\norg\.bukkit\.plugin\.UnknownDependencyException\: Unknown\/missing dependency plugins: \[([\w ,]+)\](?:\. Please download and install these plugins to run \'([^\']+)\')?/' + ]; } /** @@ -82,7 +85,14 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - parent::setMatches($matches, $patternKey); + if ($matches[4]) { + $this->pluginName = $matches[4]; + $this->pluginFilePath = $this->correctPluginPath($matches[1]); + $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); + $this->addSolution((new PluginRemoveFileSolution())->setPluginFilePath($this->getPluginFilePath())->setPluginName($this->getPluginName())); + } else { + parent::setMatches($matches, $patternKey); + } $this->dependencyPluginNames = preg_split("/, ?/", $matches[3]); foreach ($this->dependencyPluginNames as $name) { diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json index baa83e20..ac59d755 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-18-2.json @@ -356,7 +356,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'mclogs-bukkit-2.3.1' is missing the required plugins 'example2', 'example1'.", + "message": "The plugin 'Mclogs' is missing the required plugins 'example2', 'example1'.", "counter": 1, "entry": { "level": 3, @@ -399,7 +399,7 @@ }, "solutions": [ { - "message": "Install a different version of the plugin 'mclogs-bukkit-2.3.1'." + "message": "Install a different version of the plugin 'Mclogs'." }, { "message": "Delete the file 'plugins\/mclogs-bukkit-2.3.1.jar'." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json index c2e615a1..6dc1d10b 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-20-4.json @@ -405,7 +405,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'mclogs-bukkit-2.3.1' is missing the required plugins 'example1', 'example2'.", + "message": "The plugin 'Mclogs' is missing the required plugins 'example1', 'example2'.", "counter": 1, "entry": { "level": 3, @@ -456,7 +456,7 @@ }, "solutions": [ { - "message": "Install a different version of the plugin 'mclogs-bukkit-2.3.1'." + "message": "Install a different version of the plugin 'Mclogs'." }, { "message": "Delete the file 'plugins\/mclogs-bukkit-2.3.1.jar'." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json index f5a25f8f..ffd8a540 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json @@ -478,7 +478,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'mclogs-bukkit-2.6.3' is missing the required plugins 'example1', 'example2'.", + "message": "The plugin 'Mclogs' is missing the required plugins 'example1', 'example2'.", "counter": 1, "entry": { "level": 3, @@ -529,7 +529,7 @@ }, "solutions": [ { - "message": "Install a different version of the plugin 'mclogs-bukkit-2.6.3'." + "message": "Install a different version of the plugin 'Mclogs'." }, { "message": "Delete the file 'plugins\/mclogs-bukkit-2.6.3.jar'." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json index 7c38d767..cbc16eb5 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2-duplicate.json @@ -373,7 +373,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'ViaBackwards-4.2.1' is missing the required plugin 'ViaVersion'.", + "message": "The plugin 'ViaBackwards' is missing the required plugin 'ViaVersion'.", "counter": 2, "entry": { "level": 3, @@ -416,7 +416,7 @@ }, "solutions": [ { - "message": "Install a different version of the plugin 'ViaBackwards-4.2.1'." + "message": "Install a different version of the plugin 'ViaBackwards'." }, { "message": "Delete the file 'plugins\/ViaBackwards-4.2.1.jar'." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json index d31e1138..b4e684e7 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-18-2.json @@ -334,7 +334,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'ViaBackwards-4.2.1' is missing the required plugin 'ViaVersion'.", + "message": "The plugin 'ViaBackwards' is missing the required plugin 'ViaVersion'.", "counter": 1, "entry": { "level": 3, @@ -377,7 +377,7 @@ }, "solutions": [ { - "message": "Install a different version of the plugin 'ViaBackwards-4.2.1'." + "message": "Install a different version of the plugin 'ViaBackwards'." }, { "message": "Delete the file 'plugins\/ViaBackwards-4.2.1.jar'." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json index 3db73e3d..4e32e9e6 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-20-4.json @@ -471,7 +471,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'worldguard-bukkit-7.0.9-dist' is missing the required plugin 'WorldEdit'.", + "message": "The plugin 'WorldGuard' is missing the required plugin 'WorldEdit'.", "counter": 1, "entry": { "level": 3, @@ -522,7 +522,7 @@ }, "solutions": [ { - "message": "Install a different version of the plugin 'worldguard-bukkit-7.0.9-dist'." + "message": "Install a different version of the plugin 'WorldGuard'." }, { "message": "Delete the file 'plugins\/worldguard-bukkit-7.0.9-dist.jar'." diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json index 55ae8d59..5c7570b5 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-dependency-1-21-1.json @@ -753,7 +753,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'worldguard-bukkit-7.0.12-dist' is missing the required plugin 'WorldEdit'.", + "message": "The plugin 'WorldGuard' is missing the required plugin 'WorldEdit'.", "counter": 1, "entry": { "level": 3, @@ -804,7 +804,7 @@ }, "solutions": [ { - "message": "Install a different version of the plugin 'worldguard-bukkit-7.0.12-dist'." + "message": "Install a different version of the plugin 'WorldGuard'." }, { "message": "Delete the file 'plugins\/worldguard-bukkit-7.0.12-dist.jar'." From 19b9ee4a33ef09facca8dd917ba13bc6a13a794f Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Tue, 15 Oct 2024 14:02:11 +0200 Subject: [PATCH 14/20] Remove classes PluginRemoveFileSolution and PluginFileSolution. Replace PluginRemoveFileSolution with FileDeleteSolution. --- .../Bukkit/AmbiguousPluginNameProblem.php | 6 ++-- .../Bukkit/BukkitPluginFileProblem.php | 4 +-- .../Bukkit/PluginDependenciesProblem.php | 4 +-- .../Solution/Bukkit/PluginFileSolution.php | 33 ------------------- .../Bukkit/PluginRemoveFileSolution.php | 24 -------------- 5 files changed, 7 insertions(+), 64 deletions(-) delete mode 100644 src/Analysis/Solution/Bukkit/PluginFileSolution.php delete mode 100644 src/Analysis/Solution/Bukkit/PluginRemoveFileSolution.php diff --git a/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php b/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php index c0951e9a..55403841 100644 --- a/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php +++ b/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Bukkit; use Aternos\Codex\Analysis\InsightInterface; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveFileSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; use Aternos\Codex\Minecraft\Translator\Translator; /** @@ -64,8 +64,8 @@ public function setMatches(array $matches, mixed $patternKey): void $this->firstPluginPath = $this->correctPluginPath($matches[2]); $this->secondPluginPath = $this->correctPluginPath($matches[3]); - $this->addSolution((new PluginRemoveFileSolution())->setPluginFilePath($this->getFirstPluginPath())->setPluginName($this->getPluginName())); - $this->addSolution((new PluginRemoveFileSolution())->setPluginFilePath($this->getSecondPluginPath())->setPluginName($this->getPluginName())); + $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getFirstPluginPath())); + $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getSecondPluginPath())); } /** diff --git a/src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php b/src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php index 4ccb083a..2b78535e 100644 --- a/src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php +++ b/src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php @@ -4,7 +4,7 @@ use Aternos\Codex\Analysis\InsightInterface; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveFileSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; /** * Class BukkitPluginFileProblem @@ -46,7 +46,7 @@ public function setMatches(array $matches, mixed $patternKey): void $this->pluginName = $this->extractPluginName($matches[1]); $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); - $this->addSolution((new PluginRemoveFileSolution())->setPluginFilePath($this->getPluginFilePath())->setPluginName($this->getPluginName())); + $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginFilePath())); } /** diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index d1b16f25..81735851 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -5,7 +5,7 @@ use Aternos\Codex\Analysis\InsightInterface; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution; -use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveFileSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; use Aternos\Codex\Minecraft\Translator\Translator; /** @@ -89,7 +89,7 @@ public function setMatches(array $matches, mixed $patternKey): void $this->pluginName = $matches[4]; $this->pluginFilePath = $this->correctPluginPath($matches[1]); $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); - $this->addSolution((new PluginRemoveFileSolution())->setPluginFilePath($this->getPluginFilePath())->setPluginName($this->getPluginName())); + $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginFilePath())); } else { parent::setMatches($matches, $patternKey); } diff --git a/src/Analysis/Solution/Bukkit/PluginFileSolution.php b/src/Analysis/Solution/Bukkit/PluginFileSolution.php deleted file mode 100644 index 06326970..00000000 --- a/src/Analysis/Solution/Bukkit/PluginFileSolution.php +++ /dev/null @@ -1,33 +0,0 @@ -pluginFilePath; - } - - /** - * @param string $pluginFilePath - * @return $this - */ - public function setPluginFilePath(string $pluginFilePath): static - { - $this->pluginFilePath = $pluginFilePath; - return $this; - } -} \ No newline at end of file diff --git a/src/Analysis/Solution/Bukkit/PluginRemoveFileSolution.php b/src/Analysis/Solution/Bukkit/PluginRemoveFileSolution.php deleted file mode 100644 index b918bf51..00000000 --- a/src/Analysis/Solution/Bukkit/PluginRemoveFileSolution.php +++ /dev/null @@ -1,24 +0,0 @@ -getTranslation("file-delete-solution", ["file-path" => $this->getPluginFilePath()]); - } -} \ No newline at end of file From 125c10fcaf5d4a91a4d31f4e995d2b03bf1e6dce Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Tue, 15 Oct 2024 15:30:11 +0200 Subject: [PATCH 15/20] Typo fix: Rename paper-multiple-depepdencies-1-21-1 to paper-multiple-dependencies-1-21-1 --- ...es-1-21-1.json => paper-multiple-dependencies-1-21-1.json} | 0 ...cies-1-21-1.log => paper-multiple-dependencies-1-21-1.log} | 0 test/tests/Logs/AutoLogsTest.php | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename test/data/Vanilla/Bukkit/Paper/{paper-multiple-depepdencies-1-21-1.json => paper-multiple-dependencies-1-21-1.json} (100%) rename test/data/Vanilla/Bukkit/Paper/{paper-multiple-depepdencies-1-21-1.log => paper-multiple-dependencies-1-21-1.log} (100%) diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-21-1.json similarity index 100% rename from test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.json rename to test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-21-1.json diff --git a/test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.log b/test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-21-1.log similarity index 100% rename from test/data/Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.log rename to test/data/Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-21-1.log diff --git a/test/tests/Logs/AutoLogsTest.php b/test/tests/Logs/AutoLogsTest.php index e5012a37..352a287d 100644 --- a/test/tests/Logs/AutoLogsTest.php +++ b/test/tests/Logs/AutoLogsTest.php @@ -408,9 +408,9 @@ public function test_paper_multiple_dependencies_1_20_4(): void * @return void * @throws Exception */ - public function test_paper_multiple_depepdencies_1_21_1(): void + public function test_paper_multiple_dependencies_1_21_1(): void { - $log = new TestLog('Vanilla/Bukkit/Paper/paper-multiple-depepdencies-1-21-1.log'); + $log = new TestLog('Vanilla/Bukkit/Paper/paper-multiple-dependencies-1-21-1.log'); $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } From 151087dec13b32f1150a3bbf9adebbf5d8f2b5f7 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Tue, 15 Oct 2024 15:33:23 +0200 Subject: [PATCH 16/20] Fix class file version (match group) for UnsupportedClassVersionProblem --- .../Problem/Bukkit/UnsupportedClassVersionProblem.php | 2 +- .../Paper/paper-plugin-unsupported-class-version-1-16-5.json | 4 ++-- .../Paper/paper-plugin-unsupported-class-version-1-20-4.json | 4 ++-- .../Paper/paper-plugin-unsupported-class-version-1-21-1.json | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php index 679feb25..3b247476 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php @@ -41,7 +41,7 @@ public function setMatches(array $matches, mixed $patternKey): void { parent::setMatches($matches, $patternKey); - $this->classFileVersion = $matches[2]; + $this->classFileVersion = $matches[3]; $this->addSolution((new UpdateJavaSolution())->setVersion($this->getJavaVersion())); } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json index 0d60c134..85d07875 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-16-5.json @@ -464,7 +464,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'Slimefun4-1027' requires Java version -44 or later to run.", + "message": "The plugin 'Slimefun4-1027' requires Java version 16 or later to run.", "counter": 1, "entry": { "level": 3, @@ -577,7 +577,7 @@ "message": "Delete the file 'plugins\/Slimefun4-1027.jar'." }, { - "message": "Change your Java version to -44 or later." + "message": "Change your Java version to 16 or later." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json index 34a922c8..eb27c44a 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-20-4.json @@ -535,7 +535,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'worldedit-bukkit-7.3.4-beta-01' requires Java version -44 or later to run.", + "message": "The plugin 'worldedit-bukkit-7.3.4-beta-01' requires Java version 21 or later to run.", "counter": 1, "entry": { "level": 3, @@ -656,7 +656,7 @@ "message": "Delete the file 'plugins\/worldedit-bukkit-7.3.4-beta-01.jar'." }, { - "message": "Change your Java version to -44 or later." + "message": "Change your Java version to 21 or later." } ] } diff --git a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json index 952c605b..b0bd5227 100644 --- a/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json +++ b/test/data/Vanilla/Bukkit/Paper/paper-plugin-unsupported-class-version-1-21-1.json @@ -821,7 +821,7 @@ "analysis": { "problems": [ { - "message": "The plugin 'mclogs-bukkit-dev' requires Java version -44 or later to run.", + "message": "The plugin 'mclogs-bukkit-dev' requires Java version 22 or later to run.", "counter": 1, "entry": { "level": 3, @@ -946,7 +946,7 @@ "message": "Delete the file 'plugins\/mclogs-bukkit-dev.jar'." }, { - "message": "Change your Java version to -44 or later." + "message": "Change your Java version to 22 or later." } ] } From 2738f3c4f916e2dfe070dd3193f35807a4474510 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Tue, 15 Oct 2024 15:42:43 +0200 Subject: [PATCH 17/20] Override setMatches in PluginRegionalTickingProblem to set the plugin name from the match group for the plugin name, instead of using the plugin file name --- .../Problem/Folia/PluginRegionalTickingProblem.php | 12 +++++++++++- .../Folia/folia-1-19-4-unsupported-plugin.json | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php b/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php index 3c231ef5..b5aa5b43 100644 --- a/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php +++ b/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php @@ -3,6 +3,8 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Folia; use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\BukkitPluginFileProblem; +use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; +use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; use Aternos\Codex\Minecraft\Analysis\Solution\Folia\InstallNonRegionalTickingSoftwareSolution; use Aternos\Codex\Minecraft\Translator\Translator; @@ -42,8 +44,16 @@ public static function getPatterns(): array */ public function setMatches(array $matches, mixed $patternKey): void { - parent::setMatches($matches, $patternKey); + // worldedit-bukkit-7.3.4-beta-01.jar OR .paper-remapped/worldedit-bukkit-7.3.4-beta-01.jar + $pluginFileName = $this->extractPluginFileName($matches[1]); + // plugins OR plugins/.paper-remapped + $folderPath = $this->correctPluginPath($matches[2]); + $this->pluginFilePath = $folderPath . '/' . $pluginFileName; + $this->pluginName = $matches[3]; + + $this->addSolution((new PluginInstallDifferentVersionSolution())->setPluginName($this->getPluginName())); + $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginFilePath())); $this->addSolution(new InstallNonRegionalTickingSoftwareSolution()); } diff --git a/test/data/Vanilla/Bukkit/Folia/folia-1-19-4-unsupported-plugin.json b/test/data/Vanilla/Bukkit/Folia/folia-1-19-4-unsupported-plugin.json index 789fd7c3..e81b68a3 100644 --- a/test/data/Vanilla/Bukkit/Folia/folia-1-19-4-unsupported-plugin.json +++ b/test/data/Vanilla/Bukkit/Folia/folia-1-19-4-unsupported-plugin.json @@ -1971,7 +1971,7 @@ "analysis": { "problems": [ { - "message": "The plugin motdgg-bukkit-1.2.0 does not support regional ticking.", + "message": "The plugin motdgg does not support regional ticking.", "counter": 1, "entry": { "level": 3, @@ -2034,7 +2034,7 @@ }, "solutions": [ { - "message": "Install a different version of the plugin 'motdgg-bukkit-1.2.0'." + "message": "Install a different version of the plugin 'motdgg'." }, { "message": "Delete the file 'plugins\/motdgg-bukkit-1.2.0.jar'." From c1edceb240d8187db7fe839399cd509d23e28554 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Fri, 18 Oct 2024 12:46:16 +0200 Subject: [PATCH 18/20] Rename BukkitPluginProblem back to PluginProblem + rename BukkitPluginFileProblem back to PluginFileProblem --- src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php | 2 +- src/Analysis/Problem/Bukkit/PluginCommandExceptionProblem.php | 2 +- src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php | 2 +- src/Analysis/Problem/Bukkit/PluginDependencyProblem.php | 2 +- src/Analysis/Problem/Bukkit/PluginDisablingProblem.php | 2 +- src/Analysis/Problem/Bukkit/PluginEnablingProblem.php | 2 +- .../{BukkitPluginFileProblem.php => PluginFileProblem.php} | 4 ++-- src/Analysis/Problem/Bukkit/PluginLoadProblem.php | 2 +- .../Bukkit/{BukkitPluginProblem.php => PluginProblem.php} | 4 ++-- src/Analysis/Problem/Bukkit/PluginRuntimeProblem.php | 2 +- src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php | 2 +- .../Problem/Bukkit/UnsupportedClassVersionProblem.php | 2 +- src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php | 4 ++-- .../Problem/Paper/ApiVersionLowerThanAllowedProblem.php | 4 ++-- 14 files changed, 18 insertions(+), 18 deletions(-) rename src/Analysis/Problem/Bukkit/{BukkitPluginFileProblem.php => PluginFileProblem.php} (95%) rename src/Analysis/Problem/Bukkit/{BukkitPluginProblem.php => PluginProblem.php} (96%) diff --git a/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php b/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php index 55403841..f3f74f4a 100644 --- a/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php +++ b/src/Analysis/Problem/Bukkit/AmbiguousPluginNameProblem.php @@ -11,7 +11,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class AmbiguousPluginNameProblem extends BukkitPluginProblem +class AmbiguousPluginNameProblem extends PluginProblem { protected ?string $firstPluginPath = null; protected ?string $secondPluginPath = null; diff --git a/src/Analysis/Problem/Bukkit/PluginCommandExceptionProblem.php b/src/Analysis/Problem/Bukkit/PluginCommandExceptionProblem.php index 0dd5e0f1..8bdbb69d 100644 --- a/src/Analysis/Problem/Bukkit/PluginCommandExceptionProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginCommandExceptionProblem.php @@ -12,7 +12,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginCommandExceptionProblem extends BukkitPluginProblem +class PluginCommandExceptionProblem extends PluginProblem { protected ?string $command = null; diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index 81735851..61868107 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -13,7 +13,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginDependenciesProblem extends BukkitPluginFileProblem +class PluginDependenciesProblem extends PluginFileProblem { /** * @var string[] diff --git a/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php b/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php index bb9bf670..828c7425 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependencyProblem.php @@ -11,7 +11,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginDependencyProblem extends BukkitPluginFileProblem +class PluginDependencyProblem extends PluginFileProblem { protected ?string $dependencyPluginName = null; diff --git a/src/Analysis/Problem/Bukkit/PluginDisablingProblem.php b/src/Analysis/Problem/Bukkit/PluginDisablingProblem.php index 24fc251f..162ea9f7 100644 --- a/src/Analysis/Problem/Bukkit/PluginDisablingProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDisablingProblem.php @@ -9,7 +9,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginDisablingProblem extends BukkitPluginProblem +class PluginDisablingProblem extends PluginProblem { /** * Get a human-readable message diff --git a/src/Analysis/Problem/Bukkit/PluginEnablingProblem.php b/src/Analysis/Problem/Bukkit/PluginEnablingProblem.php index 7985ddd1..47e5b3e0 100644 --- a/src/Analysis/Problem/Bukkit/PluginEnablingProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginEnablingProblem.php @@ -9,7 +9,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginEnablingProblem extends BukkitPluginProblem +class PluginEnablingProblem extends PluginProblem { /** * Get a human-readable message diff --git a/src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php b/src/Analysis/Problem/Bukkit/PluginFileProblem.php similarity index 95% rename from src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php rename to src/Analysis/Problem/Bukkit/PluginFileProblem.php index 2b78535e..a2296f7b 100644 --- a/src/Analysis/Problem/Bukkit/BukkitPluginFileProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginFileProblem.php @@ -7,7 +7,7 @@ use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; /** - * Class BukkitPluginFileProblem + * Class PluginFileProblem * * Represents a problem with a Bukkit plugin file and provides: * - The file path @@ -16,7 +16,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -abstract class BukkitPluginFileProblem extends BukkitPluginProblem +abstract class PluginFileProblem extends PluginProblem { protected ?string $pluginFilePath = null; diff --git a/src/Analysis/Problem/Bukkit/PluginLoadProblem.php b/src/Analysis/Problem/Bukkit/PluginLoadProblem.php index 95d90bbe..043fd0dd 100644 --- a/src/Analysis/Problem/Bukkit/PluginLoadProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginLoadProblem.php @@ -9,7 +9,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginLoadProblem extends BukkitPluginFileProblem +class PluginLoadProblem extends PluginFileProblem { /** * Get a human-readable message diff --git a/src/Analysis/Problem/Bukkit/BukkitPluginProblem.php b/src/Analysis/Problem/Bukkit/PluginProblem.php similarity index 96% rename from src/Analysis/Problem/Bukkit/BukkitPluginProblem.php rename to src/Analysis/Problem/Bukkit/PluginProblem.php index 8813d258..957e48be 100644 --- a/src/Analysis/Problem/Bukkit/BukkitPluginProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginProblem.php @@ -7,7 +7,7 @@ use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginRemoveSolution; /** - * Class BukkitPluginProblem + * Class PluginProblem * * Represents a problem with a Bukkit plugin and provides: * - The plugin name @@ -18,7 +18,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -abstract class BukkitPluginProblem extends BukkitProblem +abstract class PluginProblem extends BukkitProblem { protected ?string $pluginName = null; diff --git a/src/Analysis/Problem/Bukkit/PluginRuntimeProblem.php b/src/Analysis/Problem/Bukkit/PluginRuntimeProblem.php index 4b3b9d66..d738bf23 100644 --- a/src/Analysis/Problem/Bukkit/PluginRuntimeProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginRuntimeProblem.php @@ -9,7 +9,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ -class PluginRuntimeProblem extends BukkitPluginProblem +class PluginRuntimeProblem extends PluginProblem { /** * Get a human-readable message diff --git a/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php index 055fadf4..e7945618 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedApiVersionProblem.php @@ -5,7 +5,7 @@ use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\ServerInstallDifferentVersionSolution; use Aternos\Codex\Minecraft\Translator\Translator; -class UnsupportedApiVersionProblem extends BukkitPluginFileProblem +class UnsupportedApiVersionProblem extends PluginFileProblem { protected ?string $apiVersion = null; diff --git a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php index 3b247476..a5f070f4 100644 --- a/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php +++ b/src/Analysis/Problem/Bukkit/UnsupportedClassVersionProblem.php @@ -5,7 +5,7 @@ use Aternos\Codex\Minecraft\Analysis\Solution\UpdateJavaSolution; use Aternos\Codex\Minecraft\Translator\Translator; -class UnsupportedClassVersionProblem extends BukkitPluginFileProblem +class UnsupportedClassVersionProblem extends PluginFileProblem { protected ?string $classFileVersion = null; diff --git a/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php b/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php index b5aa5b43..c7bf5a0d 100644 --- a/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php +++ b/src/Analysis/Problem/Folia/PluginRegionalTickingProblem.php @@ -2,7 +2,7 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Folia; -use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\BukkitPluginFileProblem; +use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\PluginFileProblem; use Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallDifferentVersionSolution; use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution; use Aternos\Codex\Minecraft\Analysis\Solution\Folia\InstallNonRegionalTickingSoftwareSolution; @@ -13,7 +13,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Folia */ -class PluginRegionalTickingProblem extends BukkitPluginFileProblem +class PluginRegionalTickingProblem extends PluginFileProblem { /** diff --git a/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php b/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php index 087d0a22..3c72bed3 100644 --- a/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php +++ b/src/Analysis/Problem/Paper/ApiVersionLowerThanAllowedProblem.php @@ -2,7 +2,7 @@ namespace Aternos\Codex\Minecraft\Analysis\Problem\Paper; -use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\BukkitPluginFileProblem; +use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\PluginFileProblem; use Aternos\Codex\Minecraft\Analysis\Solution\Paper\ChangeMinimumAllowedApiVersionSolution; use Aternos\Codex\Minecraft\Translator\Translator; @@ -11,7 +11,7 @@ * * @package Aternos\Codex\Minecraft\Analysis\Problem\Paper */ -class ApiVersionLowerThanAllowedProblem extends BukkitPluginFileProblem +class ApiVersionLowerThanAllowedProblem extends PluginFileProblem { protected ?string $pluginApiVersion = null; From 2ea2b501bd98ff6afaad7a5970111646ad0893c1 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Fri, 18 Oct 2024 12:50:48 +0200 Subject: [PATCH 19/20] Fix PHPDoc for PluginFileProblem and PluginProblem --- src/Analysis/Problem/Bukkit/PluginFileProblem.php | 6 +++--- src/Analysis/Problem/Bukkit/PluginProblem.php | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/PluginFileProblem.php b/src/Analysis/Problem/Bukkit/PluginFileProblem.php index a2296f7b..296b3d99 100644 --- a/src/Analysis/Problem/Bukkit/PluginFileProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginFileProblem.php @@ -10,9 +10,9 @@ * Class PluginFileProblem * * Represents a problem with a Bukkit plugin file and provides: - * - The file path - * - PluginInstallDifferentVersionSolution and PluginRemoveFileSolution - * and extends the BukkitPluginProblem. + * - The plugins' file path {@see PluginFileProblem::getPluginFilePath()} + * - {@link PluginInstallDifferentVersionSolution} and {@link FileDeleteSolution} + * - All features from {@link PluginProblem} (extends {@link PluginProblem}) * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ diff --git a/src/Analysis/Problem/Bukkit/PluginProblem.php b/src/Analysis/Problem/Bukkit/PluginProblem.php index 957e48be..bebd1f62 100644 --- a/src/Analysis/Problem/Bukkit/PluginProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginProblem.php @@ -10,11 +10,11 @@ * Class PluginProblem * * Represents a problem with a Bukkit plugin and provides: - * - The plugin name - * - PluginInstallDifferentVersionSolution and PluginRemoveSolution - * - Utility function to correct the plugin path - * - Utility function to extract the plugin name (without the file extension) from a plugin path - * - Utility function to extract the file name (with the file extension) from a plugin path + * - The plugin name {@see PluginProblem::getPluginName()} + * - {@link PluginInstallDifferentVersionSolution} and {@link PluginRemoveSolution} + * - Utility function to correct the plugin path {@see PluginProblem::correctPluginPath()} + * - Utility function to extract the plugin name (without the file extension) from a plugin path {@see PluginProblem::extractPluginName()} + * - Utility function to extract the file name (with the file extension) from a plugin path {@see PluginProblem::extractPluginFileName()} * * @package Aternos\Codex\Minecraft\Analysis\Problem\Bukkit */ From 56e056882400e9de14e4d67d36e7ea8f6ee39a42 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Fri, 18 Oct 2024 13:00:59 +0200 Subject: [PATCH 20/20] Remove str_replace for .paper-remapped from Pocketmine/PluginRuntimeProblem.php --- src/Analysis/Problem/Pocketmine/PluginRuntimeProblem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Analysis/Problem/Pocketmine/PluginRuntimeProblem.php b/src/Analysis/Problem/Pocketmine/PluginRuntimeProblem.php index f6337521..a6362568 100644 --- a/src/Analysis/Problem/Pocketmine/PluginRuntimeProblem.php +++ b/src/Analysis/Problem/Pocketmine/PluginRuntimeProblem.php @@ -42,7 +42,7 @@ public static function getPatterns(): array */ public function setMatches(array $matches, $patternKey): void { - $this->pluginPath = str_replace("plugins/.paper-remapped/", "plugins/", $matches[1]); + $this->pluginPath = $matches[1]; $this->pluginName = $matches[2]; $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath()));