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 lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,6 @@
"auth-server-problem": "The Mojang/Microsoft authentication servers are currently unreachable!",
"auth-server-solution": "Wait a few minutes and try again. If the issue persists, check the official Mojang/Microsoft channels for any known authentication server problems.",
"overworld-settings-missing-problem": "Overworld settings missing",
"missing-datapack-mod-problem": "Datapack is missing, because the mod '{{mod-name}}' may not be installed."
"missing-datapack-mod-problem": "Datapack is missing, because the mod '{{mod-name}}' may not be installed.",
"datapack-parsing-problem": "The datapack '{{datapack}}' could not be parsed."
}
2 changes: 2 additions & 0 deletions src/Analyser/VanillaAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\AquaticWorldOnOlderVersionProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\AuthServerProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\CodeOfConductFolderMissingProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\DatapackParsingProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\MalformedEncodingProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\OldPlayerDirectoryProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\OverworldSettingsMissingProblem;
Expand All @@ -18,6 +19,7 @@ public function __construct()
$this->addPossibleInsightClass(AquaticWorldOnOlderVersionProblem::class);
$this->addPossibleInsightClass(AuthServerProblem::class);
$this->addPossibleInsightClass(CodeOfConductFolderMissingProblem::class);
$this->addPossibleInsightClass(DatapackParsingProblem::class);
$this->addPossibleInsightClass(MalformedEncodingProblem::class);
$this->addPossibleInsightClass(OldPlayerDirectoryProblem::class);
$this->addPossibleInsightClass(OverworldSettingsMissingProblem::class);
Expand Down
43 changes: 43 additions & 0 deletions src/Analysis/Problem/Vanilla/DatapackParsingProblem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Aternos\Codex\Minecraft\Analysis\Problem\Vanilla;

use Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution;
use Aternos\Codex\Minecraft\Translator\Translator;

class DatapackParsingProblem extends VanillaProblem
{
protected string $datapack;

/**
* @inheritDoc
*/
public function getMessage(): string
{
return Translator::getInstance()->getTranslation("datapack-parsing-problem", [
"datapack" => $this->getDatapack()
]);
}

/**
* @inheritDoc
*/
public static function getPatterns(): array
{
return ['/java.lang.IllegalStateException: Failed to parse .+ from pack file\/(.*)/'];
}

/**
* @inheritDoc
*/
public function setMatches(array $matches, mixed $patternKey): void
{
$this->datapack = $matches[1];
$this->addSolution(new FileDeleteSolution($this->datapack));
}

public function getDatapack(): string
{
return $this->datapack;
}
}
Loading
Loading