fix a bug, update nightconfig
All checks were successful
Publish to snapshot maven / build (push) Successful in 25s

This commit is contained in:
moehreag 2024-06-17 20:41:10 +02:00
parent 5eaeaba14f
commit 9431528c47
2 changed files with 14 additions and 4 deletions

View file

@ -8,14 +8,14 @@ plugins {
}
group = "dev.frogmc"
version = "0.0.1-alpha.3"
version = "0.0.1-alpha.4"
repositories {
mavenCentral()
}
dependencies {
implementation("com.electronwill.night-config:json:3.7.2")
implementation("com.electronwill.night-config:json:3.7.3")
implementation("org.ow2.asm:asm:9.7")
implementation("org.ow2.asm:asm-commons:9.7")
}

View file

@ -33,10 +33,14 @@ public class Thyroxine {
paramMappings = ParchmentProvider.getParchment(minecraftVersion, outputJar.getParent());
}
remap(data, inputJar, outputJar, skipMetaInf, paramMappings);
remap(data, inputJar, outputJar, skipMetaInf, renameParameters, paramMappings);
}
public static void remap(MappingData data, Path inputJar, Path outputJar, boolean skipMetaInf, Parchment paramMappings) throws IOException, InterruptedException {
remap(data, inputJar, outputJar, skipMetaInf, true, paramMappings);
}
public static void remap(MappingData data, Path inputJar, Path outputJar, boolean skipMetaInf, boolean renameParameters, Parchment paramMappings) throws IOException, InterruptedException {
Files.deleteIfExists(outputJar);
System.out.println("Remapping...");
@ -75,7 +79,13 @@ public class Thyroxine {
ClassReader reader = new ClassReader(bytes);
ClassWriter writer = new ClassWriter(0);
ClassVisitor remapper = new ClassRemapper(writer, mapper);
reader.accept(new ParameterClassRemapper(remapper, mapper, paramMappings), 0);
ClassVisitor visitor;
if (renameParameters) {
visitor = new ParameterClassRemapper(remapper, mapper, paramMappings);
} else {
visitor = remapper;
}
reader.accept(visitor, 0);
byte[] output = writer.toByteArray();
Files.createDirectories(result.getParent());