Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Analysis/Problem/Forge/ClientOnlyModProblem.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function getMessage(): string
public static function getPatterns(): array
{
return [
'/^\s*([^\(\n]+) \(([^\)]+)\) (?:has failed to load correctly|encountered an error during[^\n]*)\n' . static::CLIENT_ONLY_CAUSE . '/m'
// the name and id stay on one line, otherwise every "(" makes the pattern scan the rest of the entry
'/^\h*([^\(\n]+) \(([^\)\n]+)\) (?:has failed to load correctly|encountered an error during[^\n]*)\n' . static::CLIENT_ONLY_CAUSE . '/m'
];
}

Expand Down
3 changes: 2 additions & 1 deletion src/Analysis/Problem/Forge/ModFatalProblem.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public static function getPatterns(): array
return [
'mod-state' => '/U[LCHIJAD]*E\s+(?<modId>\w+)\{(?<modVersion>[^\}]+)\} \[(?<modName>[^\]]+)\] \((?<modFileName>[^\)]+)\)/',
// client-only causes are handled by ClientOnlyModProblem
'failed-to-load' => '/^\s*(?<modName>[^\(\n]+) \((?<modId>[^\)]+)\) has failed to load correctly(?!\n' . ClientOnlyModProblem::CLIENT_ONLY_CAUSE . ')/m'
// the name and id stay on one line, otherwise every "(" makes the pattern scan the rest of the entry
'failed-to-load' => '/^\h*(?<modName>[^\(\n]+) \((?<modId>[^\)\n]+)\) has failed to load correctly(?!\n' . ClientOnlyModProblem::CLIENT_ONLY_CAUSE . ')/m'
];
}

Expand Down
4 changes: 0 additions & 4 deletions test/tests/Performance/PatternSafetyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

use Aternos\Codex\Analysis\PatternInsightInterface;
use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\ChunkLoadExceptionProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Forge\ClientOnlyModProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Forge\ModDependencyProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Forge\ModFatalProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Paper\ServerJarInPluginFolderProblem;
use Aternos\Codex\Minecraft\Test\Logs\TestLog;
use FilesystemIterator;
Expand Down Expand Up @@ -77,9 +75,7 @@ class PatternSafetyTest extends TestCase
*/
protected const array KNOWN_UNSAFE_PATTERNS = [
ChunkLoadExceptionProblem::class => [0, 1, 2],
ClientOnlyModProblem::class => [0],
ModDependencyProblem::class => ["loading-failed-exception"],
ModFatalProblem::class => ["failed-to-load"],
ServerJarInPluginFolderProblem::class => [0],
];

Expand Down
Loading