-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add problem for missing data pack and overworld settings missing
- Loading branch information
1 parent
f85d637
commit aea54e3
Showing
10 changed files
with
7,869 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
|
||
namespace Aternos\Codex\Minecraft\Analysis\Problem\Forge; | ||
|
||
use Aternos\Codex\Minecraft\Analysis\Solution\DoNothingSolution; | ||
use Aternos\Codex\Minecraft\Analysis\Solution\Forge\ModInstallSolution; | ||
use Aternos\Codex\Minecraft\Translator\Translator; | ||
|
||
class MissingDatapackModProblem extends ModProblem | ||
{ | ||
/** | ||
* Get a human-readable message | ||
* | ||
* @return string | ||
*/ | ||
public function getMessage(): string | ||
{ | ||
return Translator::getInstance()->getTranslation("missing-datapack-mod-problem", ["mod-name" => $this->getModName()]); | ||
} | ||
|
||
/** | ||
* Get an array of possible patterns | ||
* | ||
* The array key of the pattern will be passed to setMatches() | ||
* | ||
* @return string[] | ||
*/ | ||
public static function getPatterns(): array | ||
{ | ||
return ['/Missing data pack mod:([\w\d\-]+)/']; | ||
} | ||
|
||
/** | ||
* Apply the matches from the pattern | ||
* | ||
* @param array $matches | ||
* @param mixed $patternKey | ||
* @return void | ||
*/ | ||
public function setMatches(array $matches, mixed $patternKey): void | ||
{ | ||
$this->modName = $matches[1]; | ||
$this->addSolution((new ModInstallSolution())->setModName($this->modName)); | ||
$this->addSolution(new DoNothingSolution()); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/Analysis/Problem/Vanilla/OverworldSettingsMissingProblem.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\Vanilla\GenerateNewWorldSolution; | ||
use Aternos\Codex\Minecraft\Translator\Translator; | ||
|
||
class OverworldSettingsMissingProblem extends VanillaProblem | ||
{ | ||
/** | ||
* Get a human-readable message | ||
* | ||
* @return string | ||
*/ | ||
public function getMessage(): string | ||
{ | ||
return Translator::getInstance()->getTranslation("overworld-settings-missing-problem"); | ||
} | ||
|
||
/** | ||
* Get an array of possible patterns | ||
* | ||
* The array key of the pattern will be passed to setMatches() | ||
* | ||
* @return string[] | ||
*/ | ||
public static function getPatterns(): array | ||
{ | ||
return ['/java.util.concurrent.ExecutionException: .+ Overworld settings missing/']; | ||
} | ||
|
||
/** | ||
* Apply the matches from the pattern | ||
* | ||
* @param array $matches | ||
* @param mixed $patternKey | ||
* @return void | ||
*/ | ||
public function setMatches(array $matches, mixed $patternKey): void | ||
{ | ||
$this->addSolution(new GenerateNewWorldSolution()); | ||
} | ||
} |
Oops, something went wrong.