-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathModExceptionProblem.php
More file actions
40 lines (34 loc) · 1.15 KB
/
ModExceptionProblem.php
File metadata and controls
40 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Aternos\Codex\Minecraft\Analysis\Problem\Forge;
use Aternos\Codex\Minecraft\Analysis\Solution\Forge\ModInstallDifferentVersionSolution;
use Aternos\Codex\Minecraft\Analysis\Solution\Forge\ModRemoveSolution;
use Aternos\Codex\Minecraft\Translator\Translator;
class ModExceptionProblem extends ModProblem
{
/**
* @inheritDoc
*/
public function getMessage(): string
{
return Translator::getInstance()->getTranslation("mod-exception-problem", ["mod-name" => $this->getModName()]);
}
/**
* @inheritDoc
*/
public static function getPatterns(): array
{
return [
'/Caught exception from ([^\(\n]+)/',
'/net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: \[\s+([^\(\n]+) \([^\)]+\) encountered an error during/'
];
}
/**
* @inheritDoc
*/
public function setMatches(array $matches, mixed $patternKey): void
{
$this->modName = trim($matches[1]);
$this->addSolution(new ModInstallDifferentVersionSolution($this->getModName()));
$this->addSolution(new ModRemoveSolution($this->getModName()));
}
}