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" group = "dev.frogmc"
version = "0.0.1-alpha.25" version = "0.0.1-alpha.26"
repositories { repositories {
maven { maven {

View file

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

View file

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

View file

@ -129,13 +129,15 @@ public class MinecraftGamePlugin implements GamePlugin {
if (!loader.isDevelopment()) { if (!loader.isDevelopment()) {
if (!Files.exists(remappedGamePath)) { if (!Files.exists(remappedGamePath)) {
LOGGER.atInfo().setMessage("Remapping game, this may take a moment...").log();
MappingBundle mappings; MappingBundle mappings;
String mappingPath = System.getProperty(SystemProperties.INTERMEDIARY_MAPPINGS); String mappingPath = System.getProperty(SystemProperties.INTERMEDIARY_MAPPINGS);
try { try {
if (mappingPath != null) { if (mappingPath != null) {
mappings = readIntemediaryMappings(mappingPath); mappings = readIntemediaryMappings(mappingPath);
} else { } 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) { if (mappings == null) {
mappings = readIntemediaryMappings("/mappings/mappings.tiny"); mappings = readIntemediaryMappings("/mappings/mappings.tiny");
@ -145,7 +147,7 @@ public class MinecraftGamePlugin implements GamePlugin {
return; return;
} }
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("Failed to remap game: ", e); throw new IllegalStateException("Failed to remap game: ", e);
} }
runtimePath = gamePath; runtimePath = gamePath;
LOGGER.error("No intermediary mappings found! The game will be launched obfuscated. Mods are likely to error! " + 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)); data = Files.readString(Paths.get(path));
} }
try { 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) { } catch (IllegalStateException e) {
throw new IllegalStateException("Failed to read intermediary mappings: " + data, e); throw new IllegalStateException("Failed to read intermediary mappings: " + data, e);
} }