From 46730aaf9fdf4eea826fd4fe004962d6c579299c Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 11 Sep 2024 15:28:26 +0200 Subject: [PATCH 1/2] Update aternos/codex to 2.2.0 --- composer.json | 2 +- composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index f4b7095..11d95f1 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": ">=8.1.0", - "aternos/codex": "^2.1.1", + "aternos/codex": "^2.2.0", "ext-json": "*" }, "require-dev": { diff --git a/composer.lock b/composer.lock index cbfa442..aa71dee 100644 --- a/composer.lock +++ b/composer.lock @@ -4,27 +4,27 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ff0a1442e0c85a1d614e81ebe9f12ff8", + "content-hash": "db96acc55b7bc25d09d91d43fe0d416c", "packages": [ { "name": "aternos/codex", - "version": "v2.1.1", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/aternosorg/codex.git", - "reference": "e14a34d63bd4d16ffa46bfed6a98e2bda8e822f1" + "reference": "8f7615e98ff001cc7e268165c1daf717e2fdc9cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aternosorg/codex/zipball/e14a34d63bd4d16ffa46bfed6a98e2bda8e822f1", - "reference": "e14a34d63bd4d16ffa46bfed6a98e2bda8e822f1", + "url": "https://api.github.com/repos/aternosorg/codex/zipball/8f7615e98ff001cc7e268165c1daf717e2fdc9cb", + "reference": "8f7615e98ff001cc7e268165c1daf717e2fdc9cb", "shasum": "" }, "require": { "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.5" }, "type": "library", "autoload": { @@ -45,9 +45,9 @@ "description": "PHP library to read, parse, print and analyse log files.", "support": { "issues": "https://github.com/aternosorg/codex/issues", - "source": "https://github.com/aternosorg/codex/tree/v2.1.1" + "source": "https://github.com/aternosorg/codex/tree/v2.2.0" }, - "time": "2024-01-09T16:20:53+00:00" + "time": "2024-09-11T12:33:08+00:00" } ], "packages-dev": [ From 7815d2b7365fe8e79237069ebf3e2b2f9c502d82 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 11 Sep 2024 17:17:54 +0200 Subject: [PATCH 2/2] Update getDetectors() for client logs and crash reports to use MultiPatternDetector --- .../Vanilla/Bukkit/Folia/FoliaCrashReport.php | 7 +++++-- .../Vanilla/Bukkit/Paper/PaperCrashReportLog.php | 7 +++++-- .../Bukkit/Purpur/PurpurCrashReportLog.php | 7 +++++-- .../Minecraft/Vanilla/Fabric/FabricClientLog.php | 6 ++++-- .../Vanilla/Fabric/FabricCrashReportLog.php | 14 ++++++++++---- .../Forge/Arclight/ArclightCrashReportLog.php | 15 +++++++++++---- .../Minecraft/Vanilla/Forge/ForgeClientLog.php | 10 +++++++--- .../Vanilla/Forge/ForgeCrashReportLog.php | 12 +++++++----- .../Vanilla/NeoForge/NeoForgeClientLog.php | 6 ++++-- .../Vanilla/NeoForge/NeoForgeCrashReportLog.php | 8 ++++++-- .../Minecraft/Vanilla/Quilt/QuiltClientLog.php | 6 ++++-- .../Vanilla/Quilt/QuiltCrashReportLog.php | 14 ++++++++++---- 12 files changed, 78 insertions(+), 34 deletions(-) diff --git a/src/Log/Minecraft/Vanilla/Bukkit/Folia/FoliaCrashReport.php b/src/Log/Minecraft/Vanilla/Bukkit/Folia/FoliaCrashReport.php index a11cac5..a09acfc 100644 --- a/src/Log/Minecraft/Vanilla/Bukkit/Folia/FoliaCrashReport.php +++ b/src/Log/Minecraft/Vanilla/Bukkit/Folia/FoliaCrashReport.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Bukkit\Folia; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; use Aternos\Codex\Minecraft\Log\Type\CrashReportLogTypeInterface; @@ -21,6 +21,9 @@ class FoliaCrashReport extends FoliaLog implements CrashReportLogTypeInterface */ public static function getDetectors(): array { - return [(new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\s+Running: Folia version git-Folia/m")]; + return [(new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/") + ->addPattern("/^\tRunning: Folia version git-Folia/m") + ]; } } \ No newline at end of file diff --git a/src/Log/Minecraft/Vanilla/Bukkit/Paper/PaperCrashReportLog.php b/src/Log/Minecraft/Vanilla/Bukkit/Paper/PaperCrashReportLog.php index 6241b2a..9913896 100644 --- a/src/Log/Minecraft/Vanilla/Bukkit/Paper/PaperCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/Bukkit/Paper/PaperCrashReportLog.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Bukkit\Paper; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; use Aternos\Codex\Minecraft\Log\Type\CrashReportLogTypeInterface; @@ -21,6 +21,9 @@ class PaperCrashReportLog extends PaperLog implements CrashReportLogTypeInterfac */ public static function getDetectors(): array { - return [(new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\s+Running: Paper version git-Paper/m")]; + return [(new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\s+Running: Paper version git-Paper/m") + ]; } } \ No newline at end of file diff --git a/src/Log/Minecraft/Vanilla/Bukkit/Purpur/PurpurCrashReportLog.php b/src/Log/Minecraft/Vanilla/Bukkit/Purpur/PurpurCrashReportLog.php index 00e9cdf..622a730 100644 --- a/src/Log/Minecraft/Vanilla/Bukkit/Purpur/PurpurCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/Bukkit/Purpur/PurpurCrashReportLog.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Bukkit\Purpur; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; use Aternos\Codex\Minecraft\Log\Type\CrashReportLogTypeInterface; @@ -21,6 +21,9 @@ class PurpurCrashReportLog extends PurpurLog implements CrashReportLogTypeInterf */ public static function getDetectors(): array { - return [(new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\s+Running: Purpur version git-Purpur/m")]; + return [(new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\tRunning: Purpur version git-Purpur/m") + ]; } } \ No newline at end of file diff --git a/src/Log/Minecraft/Vanilla/Fabric/FabricClientLog.php b/src/Log/Minecraft/Vanilla/Fabric/FabricClientLog.php index 8467abd..c900f17 100644 --- a/src/Log/Minecraft/Vanilla/Fabric/FabricClientLog.php +++ b/src/Log/Minecraft/Vanilla/Fabric/FabricClientLog.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Fabric; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Log\Type\ClientLogTypeInterface; /** @@ -19,7 +19,9 @@ class FabricClientLog extends FabricLog implements ClientLogTypeInterface public static function getDetectors(): array { return [ - (new SinglePatternDetector())->setPattern('#^\[[\d:]+\] \[main\/INFO\](?:\:| \(FabricLoader/GameProvider\)) Loading Minecraft [^ \n]+ with Fabric Loader [^ \n]+(\n.*)*\n\[[\d:]+\] \[(?:Render thread|main)\/INFO\](?:\:| \(Minecraft\)) Setting user: \w+#m'), + (new MultiPatternDetector()) + ->addPattern('#^\[[\d:]+\] \[main\/INFO\](?:\:| \(FabricLoader/GameProvider\)) Loading Minecraft [^ \n]+ with Fabric Loader [^ \n]+#') + ->addPattern('#^\[[\d:]+\] \[(?:Render thread|main)\/INFO\](?:\:| \(Minecraft\)) Setting user: \w+#m') ]; } } \ No newline at end of file diff --git a/src/Log/Minecraft/Vanilla/Fabric/FabricCrashReportLog.php b/src/Log/Minecraft/Vanilla/Fabric/FabricCrashReportLog.php index 8d66ade..000f731 100644 --- a/src/Log/Minecraft/Vanilla/Fabric/FabricCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/Fabric/FabricCrashReportLog.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Fabric; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\FabricCrashReportAnalyser; use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\MinecraftCrashReportAnalyser; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; @@ -24,9 +24,15 @@ class FabricCrashReportLog extends FabricLog implements CrashReportLogTypeInterf public static function getDetectors(): array { return [ - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\t(?:Known )?server brands?: fabric/im"), - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\tIs Modded: Definitely; Client brand changed to 'fabric'/im"), - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\tIs Modded: Definitely; Server brand changed to 'fabric'/im"), + (new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\t(?:Known )?server brands?: fabric$/im"), + (new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\tIs Modded: Definitely; Client brand changed to 'fabric'$/im"), + (new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\tIs Modded: Definitely; Server brand changed to 'fabric'$/im"), ]; } diff --git a/src/Log/Minecraft/Vanilla/Forge/Arclight/ArclightCrashReportLog.php b/src/Log/Minecraft/Vanilla/Forge/Arclight/ArclightCrashReportLog.php index d9f0e9b..fc10823 100644 --- a/src/Log/Minecraft/Vanilla/Forge/Arclight/ArclightCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/Forge/Arclight/ArclightCrashReportLog.php @@ -3,12 +3,12 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Forge\Arclight; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; use Aternos\Codex\Minecraft\Log\Type\CrashReportLogTypeInterface; /** - * Class MohistCrashReportLog + * Class ArclightCrashReportLog * * @package Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Forge\Mohist */ @@ -22,8 +22,15 @@ class ArclightCrashReportLog extends ArclightLog implements CrashReportLogTypeIn public static function getDetectors(): array { return [ - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\tKnown server brands:( [a-zA-Z])* arclight/m"), - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\tIs Modded: Definitely; Server brand changed to 'arclight'/im") + (new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\t(?:Known )?server brands?: arclight/im"), + (new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\tIs Modded: Definitely; Client brand changed to 'arclight'$/im"), + (new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\tIs Modded: Definitely; Server brand changed to 'arclight'$/im"), ]; } } \ No newline at end of file diff --git a/src/Log/Minecraft/Vanilla/Forge/ForgeClientLog.php b/src/Log/Minecraft/Vanilla/Forge/ForgeClientLog.php index 391b032..3222534 100644 --- a/src/Log/Minecraft/Vanilla/Forge/ForgeClientLog.php +++ b/src/Log/Minecraft/Vanilla/Forge/ForgeClientLog.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Forge; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Log\Type\ClientLogTypeInterface; /** @@ -19,8 +19,12 @@ class ForgeClientLog extends ForgeLog implements ClientLogTypeInterface public static function getDetectors(): array { return [ - (new SinglePatternDetector())->setPattern('/^\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: ModLauncher running: .*--fml.forgeVersion.*(\n.*)*\n\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: Launching target \'(fml|forge)client\' with arguments.*$/m'), - (new SinglePatternDetector())->setPattern('/^\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: Forge Mod Loader version.*(\n.*)*\n\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: Launching wrapped minecraft \{net\.minecraft\.client/m') + (new MultiPatternDetector()) + ->addPattern('/^\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: ModLauncher running: .*--fml.forgeVersion/m') + ->addPattern('/^\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: Launching target \'(fml|forge)client\' with arguments/m'), + (new MultiPatternDetector()) + ->addPattern('/^\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: Forge Mod Loader version/m') + ->addPattern('/^\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: Launching wrapped minecraft \{net\.minecraft\.client/m') ]; } } \ No newline at end of file diff --git a/src/Log/Minecraft/Vanilla/Forge/ForgeCrashReportLog.php b/src/Log/Minecraft/Vanilla/Forge/ForgeCrashReportLog.php index eb504f8..0025586 100644 --- a/src/Log/Minecraft/Vanilla/Forge/ForgeCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/Forge/ForgeCrashReportLog.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Forge; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\ForgeCrashReportAnalyser; use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\MinecraftCrashReportAnalyser; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; @@ -24,10 +24,12 @@ class ForgeCrashReportLog extends ForgeLog implements CrashReportLogTypeInterfac public static function getDetectors(): array { return [ - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\tFML:/m"), - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\tIs Modded: Definitely; Client brand changed to '(?:fml,)?forge'/im"), - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\tIs Modded: Definitely; Server brand changed to '(?:fml,)?forge'/im"), - + (new MultiPatternDetector()) + ->addPattern("/---- Minecraft Crash Report ----$/m") + ->addPattern("/^\tIs Modded: Definitely; Client brand changed to '(?:fml,)?forge'/im"), + (new MultiPatternDetector()) + ->addPattern("/---- Minecraft Crash Report ----$/m") + ->addPattern("/^\tIs Modded: Definitely; Server brand changed to '(?:fml,)?forge'/im"), ]; } diff --git a/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeClientLog.php b/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeClientLog.php index 8aee883..f498199 100644 --- a/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeClientLog.php +++ b/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeClientLog.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\NeoForge; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Log\Type\ClientLogTypeInterface; class NeoForgeClientLog extends NeoForgeLog implements ClientLogTypeInterface @@ -14,7 +14,9 @@ class NeoForgeClientLog extends NeoForgeLog implements ClientLogTypeInterface public static function getDetectors(): array { return [ - (new SinglePatternDetector())->setPattern('/^\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: ModLauncher running: .*--fml.neoForgeVersion.*(\n.*)*\n\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: Launching target \'(fml|forge)client\' with arguments.*$/m') + (new MultiPatternDetector()) + ->addPattern('/^\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: ModLauncher running: .*--fml.neoForgeVersion/m') + ->addPattern('/^\[[^\]]+\] \[main\/INFO\]( \[[^\]]+\])?: Launching target \'(fml|forge)client\' with arguments/m'), ]; } } \ No newline at end of file diff --git a/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeCrashReportLog.php b/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeCrashReportLog.php index 3dd6c9c..feec21f 100644 --- a/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeCrashReportLog.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\NeoForge; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\MinecraftCrashReportAnalyser; use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\NeoForgeCrashReportAnalyser; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; @@ -18,7 +18,11 @@ class NeoForgeCrashReportLog extends NeoForgeLog implements CrashReportLogTypeIn */ public static function getDetectors(): array { - return [(new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\tNeoForge:/m")]; + return [ + (new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\tNeoForge: net\.neoforged:/m"), + ]; } diff --git a/src/Log/Minecraft/Vanilla/Quilt/QuiltClientLog.php b/src/Log/Minecraft/Vanilla/Quilt/QuiltClientLog.php index 220132f..79fecb6 100644 --- a/src/Log/Minecraft/Vanilla/Quilt/QuiltClientLog.php +++ b/src/Log/Minecraft/Vanilla/Quilt/QuiltClientLog.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Quilt; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Log\Type\ClientLogTypeInterface; /** @@ -19,7 +19,9 @@ class QuiltClientLog extends QuiltLog implements ClientLogTypeInterface public static function getDetectors(): array { return [ - (new SinglePatternDetector())->setPattern('/\[[\d:]+\] \[main\/INFO\]: Loading Minecraft [^ \n]+ with Quilt Loader [^ \n]+(\n.*)*\n\[[\d:]+\] \[Render thread\/INFO\]: Setting user: \w+/'), + (new MultiPatternDetector()) + ->addPattern('/^\[[\d:]+\] \[main\/INFO\]: Loading Minecraft [^ \n]+ with Quilt Loader [^ \n]+/') + ->addPattern('/^\[[\d:]+\] \[(?:Render thread|main)\/INFO\]: Setting user: \w+/m') ]; } } \ No newline at end of file diff --git a/src/Log/Minecraft/Vanilla/Quilt/QuiltCrashReportLog.php b/src/Log/Minecraft/Vanilla/Quilt/QuiltCrashReportLog.php index 8febbda..8b25366 100644 --- a/src/Log/Minecraft/Vanilla/Quilt/QuiltCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/Quilt/QuiltCrashReportLog.php @@ -3,7 +3,7 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Quilt; use Aternos\Codex\Detective\DetectorInterface; -use Aternos\Codex\Detective\SinglePatternDetector; +use Aternos\Codex\Detective\MultiPatternDetector; use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\MinecraftCrashReportAnalyser; use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\QuiltCrashReportAnalyser; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; @@ -19,9 +19,15 @@ class QuiltCrashReportLog extends QuiltLog implements CrashReportLogTypeInterfac public static function getDetectors(): array { return [ - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\t(?:Known )?server brands?: quilt/im"), - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\tIs Modded: Definitely; Client brand changed to 'quilt'/im"), - (new SinglePatternDetector())->setPattern("/---- Minecraft Crash Report ----(\n.*)*\n\tIs Modded: Definitely; Server brand changed to 'quilt'/im") + (new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\t(?:Known )?server brands?: quilt/im"), + (new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\tIs Modded: Definitely; Client brand changed to 'quilt'$/im"), + (new MultiPatternDetector()) + ->addPattern("/^---- Minecraft Crash Report ----$/m") + ->addPattern("/^\tIs Modded: Definitely; Server brand changed to 'quilt'$/im"), ]; }