Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -89,5 +89,6 @@
"plugin-api-version-lower-than-allowed-problem": "The plugin '{{plugin-name}}' has an API version specified that is lower than the minimum allowed version.",
"change-minimum-api-version-solution": "Change 'minimum-api' in bukkit.yml to {{api-version}}, lower or even 'none'.",
"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."
"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": "Regenerate your world."
}
3 changes: 2 additions & 1 deletion src/Analyser/ForgeAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Aternos\Codex\Minecraft\Analysis\Information\Vanilla\VanillaVersionInformation;
use Aternos\Codex\Minecraft\Analysis\Problem\Forge\FmlConfirmProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Forge\LanguageProviderVersionProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Forge\MissingDatapackModProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Forge\ModDependencyProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Forge\ModDuplicateProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Forge\ModExceptionProblem;
Expand All @@ -31,7 +32,6 @@ public function __construct()
$this->addPossibleInsightClass(ForgeVersionInformation::class);
$this->overridePossibleInsightClass(VanillaVersionInformation::class, ForgeVanillaVersionInformation::class);
$this->addPossibleInsightClass(ForgeJavaVersionInformation::class);

$this->addPossibleInsightClass(FmlConfirmProblem::class);
$this->addPossibleInsightClass(WorldMissingModProblem::class);
$this->addPossibleInsightClass(WorldModVersionProblem::class);
Expand All @@ -43,5 +43,6 @@ public function __construct()
$this->addPossibleInsightClass(PTRLibDependencyProblem::class);
$this->addPossibleInsightClass(MultipleModulesExportProblem::class);
$this->addPossibleInsightClass(LanguageProviderVersionProblem::class);
$this->addPossibleInsightClass(MissingDatapackModProblem::class);
}
}
3 changes: 2 additions & 1 deletion 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\MalformedEncodingProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\OldPlayerDirectoryProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\OverworldSettingsMissingProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\TickingBlockEntityProblem;
use Aternos\Codex\Minecraft\Analysis\Problem\Vanilla\AuthServerProblem;

Expand All @@ -19,11 +20,11 @@ class VanillaAnalyser extends MinecraftAnalyser
public function __construct()
{
$this->addPossibleInsightClass(VanillaVersionInformation::class);

$this->addPossibleInsightClass(OldPlayerDirectoryProblem::class);
$this->addPossibleInsightClass(AquaticWorldOnOlderVersionProblem::class);
$this->addPossibleInsightClass(TickingBlockEntityProblem::class);
$this->addPossibleInsightClass(MalformedEncodingProblem::class);
$this->addPossibleInsightClass(AuthServerProblem::class);
$this->addPossibleInsightClass(OverworldSettingsMissingProblem::class);
}
}
47 changes: 47 additions & 0 deletions src/Analysis/Problem/Forge/MissingDatapackModProblem.php
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("mod-install-solution");
}

/**
* 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($matches[1]));
$this->addSolution(new DoNothingSolution());
}
}
43 changes: 43 additions & 0 deletions src/Analysis/Problem/Vanilla/OverworldSettingsMissingProblem.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\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");
}

/**
* 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 ['/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());
}
}
225 changes: 225 additions & 0 deletions test/data/Vanilla/missing-data-pack-mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
{
"id": "forge\/server",
"name": "Forge",
"type": "Server Log",
"version": null,
"title": "Forge Server Log",
"entries": [
{
"level": 6,
"time": null,
"prefix": "[29Oct2024 12:58:07.579] [Forge Version Check\/INFO] [net.minecraftforge.fml.VersionChecker\/]:",
"lines": [
{
"number": 1,
"content": "[29Oct2024 12:58:07.579] [Forge Version Check\/INFO] [net.minecraftforge.fml.VersionChecker\/]: [forge] Found status: BETA Current: 52.0.24 Target: 52.0.24"
}
]
},
{
"level": 6,
"time": null,
"prefix": "[29Oct2024 12:58:08.768] [main\/INFO] [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService\/]:",
"lines": [
{
"number": 2,
"content": "[29Oct2024 12:58:08.768] [main\/INFO] [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService\/]: Environment: Environment[sessionHost=https:\/\/sessionserver.mojang.com, servicesHost=https:\/\/api.minecraftservices.com, name=PROD]"
}
]
},
{
"level": 4,
"time": null,
"prefix": "[29Oct2024 12:58:08.897] [main\/WARN] [net.minecraftforge.common.ForgeHooks\/WP]:",
"lines": [
{
"number": 3,
"content": "[29Oct2024 12:58:08.897] [main\/WARN] [net.minecraftforge.common.ForgeHooks\/WP]: The following mods have version differences that were not resolved:"
},
{
"number": 4,
"content": "commonnetworking (version 1.0.16-1.21.1 -> MISSING)"
},
{
"number": 5,
"content": "journeymap (version 1.21.1-6.0.0-beta.28 -> MISSING)"
},
{
"number": 6,
"content": "journeymap_api (version 2.0.0 -> MISSING)"
},
{
"number": 7,
"content": "terralith (version 2.5.5 -> MISSING)"
},
{
"number": 8,
"content": "Things may not work well."
}
]
},
{
"level": 7,
"time": null,
"prefix": "[29Oct2024 12:58:09.638] [main\/DEBUG] [net.minecraftforge.resource.ResourcePackLoader\/CORE]:",
"lines": [
{
"number": 9,
"content": "[29Oct2024 12:58:09.638] [main\/DEBUG] [net.minecraftforge.resource.ResourcePackLoader\/CORE]: Generating PackInfo named mod:forge for mod file \/server\/libraries\/net\/minecraftforge\/forge\/1.21.1-52.0.24\/forge-1.21.1-52.0.24-universal.jar"
}
]
},
{
"level": 4,
"time": null,
"prefix": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]:",
"lines": [
{
"number": 10,
"content": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]: Missing data pack mod:terralith"
}
]
},
{
"level": 4,
"time": null,
"prefix": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]:",
"lines": [
{
"number": 11,
"content": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]: Missing data pack mod:commonnetworking"
}
]
},
{
"level": 4,
"time": null,
"prefix": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]:",
"lines": [
{
"number": 12,
"content": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]: Missing data pack mod:journeymap_api"
}
]
},
{
"level": 4,
"time": null,
"prefix": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]:",
"lines": [
{
"number": 13,
"content": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]: Missing data pack mod:journeymap"
}
]
},
{
"level": 4,
"time": null,
"prefix": "[29Oct2024 12:58:10.546] [main\/WARN] [net.minecraft.server.Main\/]:",
"lines": [
{
"number": 14,
"content": "[29Oct2024 12:58:10.546] [main\/WARN] [net.minecraft.server.Main\/]: Failed to load datapacks, can't proceed with server load. You can either fix your datapacks or reset to vanilla with --safeMode"
}
]
}
],
"analysis": {
"problems": [
{
"message": "Install the mod '{{mod-name}}'.",
"counter": 1,
"entry": {
"level": 4,
"time": null,
"prefix": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]:",
"lines": [
{
"number": 10,
"content": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]: Missing data pack mod:terralith"
}
]
},
"solutions": [
{
"message": "Install the mod 'terralith'."
},
{
"message": "Do nothing. This problem might fix itself."
}
]
},
{
"message": "Install the mod '{{mod-name}}'.",
"counter": 1,
"entry": {
"level": 4,
"time": null,
"prefix": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]:",
"lines": [
{
"number": 11,
"content": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]: Missing data pack mod:commonnetworking"
}
]
},
"solutions": [
{
"message": "Install the mod 'commonnetworking'."
},
{
"message": "Do nothing. This problem might fix itself."
}
]
},
{
"message": "Install the mod '{{mod-name}}'.",
"counter": 1,
"entry": {
"level": 4,
"time": null,
"prefix": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]:",
"lines": [
{
"number": 12,
"content": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]: Missing data pack mod:journeymap_api"
}
]
},
"solutions": [
{
"message": "Install the mod 'journeymap_api'."
},
{
"message": "Do nothing. This problem might fix itself."
}
]
},
{
"message": "Install the mod '{{mod-name}}'.",
"counter": 1,
"entry": {
"level": 4,
"time": null,
"prefix": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]:",
"lines": [
{
"number": 13,
"content": "[29Oct2024 12:58:09.639] [main\/WARN] [net.minecraft.server.MinecraftServer\/]: Missing data pack mod:journeymap"
}
]
},
"solutions": [
{
"message": "Install the mod 'journeymap'."
},
{
"message": "Do nothing. This problem might fix itself."
}
]
}
],
"information": []
}
}
14 changes: 14 additions & 0 deletions test/data/Vanilla/missing-data-pack-mod.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[29Oct2024 12:58:07.579] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Found status: BETA Current: 52.0.24 Target: 52.0.24
[29Oct2024 12:58:08.768] [main/INFO] [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService/]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD]
[29Oct2024 12:58:08.897] [main/WARN] [net.minecraftforge.common.ForgeHooks/WP]: The following mods have version differences that were not resolved:
commonnetworking (version 1.0.16-1.21.1 -> MISSING)
journeymap (version 1.21.1-6.0.0-beta.28 -> MISSING)
journeymap_api (version 2.0.0 -> MISSING)
terralith (version 2.5.5 -> MISSING)
Things may not work well.
[29Oct2024 12:58:09.638] [main/DEBUG] [net.minecraftforge.resource.ResourcePackLoader/CORE]: Generating PackInfo named mod:forge for mod file /server/libraries/net/minecraftforge/forge/1.21.1-52.0.24/forge-1.21.1-52.0.24-universal.jar
[29Oct2024 12:58:09.639] [main/WARN] [net.minecraft.server.MinecraftServer/]: Missing data pack mod:terralith
[29Oct2024 12:58:09.639] [main/WARN] [net.minecraft.server.MinecraftServer/]: Missing data pack mod:commonnetworking
[29Oct2024 12:58:09.639] [main/WARN] [net.minecraft.server.MinecraftServer/]: Missing data pack mod:journeymap_api
[29Oct2024 12:58:09.639] [main/WARN] [net.minecraft.server.MinecraftServer/]: Missing data pack mod:journeymap
[29Oct2024 12:58:10.546] [main/WARN] [net.minecraft.server.Main/]: Failed to load datapacks, can't proceed with server load. You can either fix your datapacks or reset to vanilla with --safeMode
Loading