Skip to content

Commit edd8476

Browse files
authored
Merge pull request #105 from aternosorg/fabric-mixin-error
Detect Fatal Mixin errors on fabric
2 parents eb9023c + c3976c1 commit edd8476

File tree

5 files changed

+1362
-0
lines changed

5 files changed

+1362
-0
lines changed

src/Analyser/FabricAnalyser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Aternos\Codex\Minecraft\Analysis\Problem\Fabric\FabricDuplicateModProblem;
1010
use Aternos\Codex\Minecraft\Analysis\Problem\Fabric\FabricEntryStageProblem;
1111
use Aternos\Codex\Minecraft\Analysis\Problem\Fabric\FabricIncompatibleModsProblem;
12+
use Aternos\Codex\Minecraft\Analysis\Problem\Fabric\FabricMixinProblem;
1213
use Aternos\Codex\Minecraft\Analysis\Problem\Fabric\FabricModDependencyProblem;
1314

1415
/**
@@ -25,6 +26,7 @@ public function __construct()
2526
$this->overridePossibleInsightClass(VanillaVersionInformation::class, FabricVanillaVersionInformation::class);
2627
$this->addPossibleInsightClass(FabricJavaVersionInformation::class);
2728
$this->addPossibleInsightClass(FabricModDependencyProblem::class);
29+
$this->addPossibleInsightClass(FabricMixinProblem::class);
2830
$this->addPossibleInsightClass(FabricIncompatibleModsProblem::class);
2931
$this->addPossibleInsightClass(FabricDuplicateModProblem::class);
3032
$this->addPossibleInsightClass(FabricEntryStageProblem::class);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace Aternos\Codex\Minecraft\Analysis\Problem\Fabric;
4+
5+
use Aternos\Codex\Minecraft\Analysis\Solution\Forge\ModRemoveSolution;
6+
use Aternos\Codex\Minecraft\Translator\Translator;
7+
8+
class FabricMixinProblem extends FabricModProblem
9+
{
10+
/**
11+
* @inheritDoc
12+
*/
13+
public function getMessage(): string
14+
{
15+
return Translator::getInstance()->getTranslation("mod-fatal-problem", ["mod-name" => $this->getModName()]);
16+
}
17+
18+
/**
19+
* @inheritDoc
20+
*/
21+
public static function getPatterns(): array
22+
{
23+
return [
24+
"/MixinTransformerError: An unexpected critical error was encountered\n(?:.*\n)*Caused by: .* from mod " . static::$modIDPattern . "/"
25+
];
26+
}
27+
28+
/**
29+
* @inheritDoc
30+
*/
31+
public function setMatches(array $matches, mixed $patternKey): void
32+
{
33+
$this->setModName($matches[1]);
34+
$this->addSolution((new ModRemoveSolution())->setModName($this->getModName()));
35+
}
36+
}

0 commit comments

Comments
 (0)