fix remapping, add a bit of logging
All checks were successful
Publish to snapshot maven / build (push) Successful in 23s

This commit is contained in:
moehreag 2024-08-28 13:11:11 +02:00
parent be4e6530f4
commit f7c90d15e6
4 changed files with 10 additions and 6 deletions

View file

@ -7,7 +7,7 @@ plugins {
}
group = "dev.frogmc"
version = "0.0.1-alpha.25"
version = "0.0.1-alpha.26"
repositories {
maven {

View file

@ -1,6 +1,6 @@
[versions]
thyroxine = "0.0.1-alpha.13"
thyroxine = "0.0.1-alpha.15"
nightconfig = "3.8.1"
mixin = "0.15.0+mixin.0.8.7"
annotations = "24.1.0"

View file

@ -1,6 +1,6 @@
plugins {
java
id("dev.frogmc.phytotelma") version "0.0.1-alpha.20"
id("dev.frogmc.phytotelma") version "0.0.1-alpha.21"
}
dependencies {

View file

@ -129,13 +129,15 @@ public class MinecraftGamePlugin implements GamePlugin {
if (!loader.isDevelopment()) {
if (!Files.exists(remappedGamePath)) {
LOGGER.atInfo().setMessage("Remapping game, this may take a moment...").log();
MappingBundle mappings;
String mappingPath = System.getProperty(SystemProperties.INTERMEDIARY_MAPPINGS);
try {
if (mappingPath != null) {
mappings = readIntemediaryMappings(mappingPath);
} else {
mappings = MojmapProvider.get(version, remappedGamePath.resolveSibling("client-" + version + ".txt")).orElse(null);
mappings = MojmapProvider.get(version, remappedGamePath.resolveSibling("client-" + version + ".txt"))
.reverse();
}
if (mappings == null) {
mappings = readIntemediaryMappings("/mappings/mappings.tiny");
@ -145,7 +147,7 @@ public class MinecraftGamePlugin implements GamePlugin {
return;
}
} catch (Exception e) {
LOGGER.error("Failed to remap game: ", e);
throw new IllegalStateException("Failed to remap game: ", e);
}
runtimePath = gamePath;
LOGGER.error("No intermediary mappings found! The game will be launched obfuscated. Mods are likely to error! " +
@ -166,7 +168,9 @@ public class MinecraftGamePlugin implements GamePlugin {
data = Files.readString(Paths.get(path));
}
try {
return TinyV2Parser.parse(data);
MappingBundle mappings = TinyV2Parser.parse(data);
LOGGER.warn("Using non-standard intermediary mappings! Mods may not work!");
return mappings;
} catch (IllegalStateException e) {
throw new IllegalStateException("Failed to read intermediary mappings: " + data, e);
}