fix remapping those weird formats
All checks were successful
Publish to snapshot maven / build (push) Successful in 19s
All checks were successful
Publish to snapshot maven / build (push) Successful in 19s
This commit is contained in:
parent
25fefae245
commit
69b62e7d0e
|
@ -8,7 +8,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "dev.frogmc"
|
group = "dev.frogmc"
|
||||||
version = "0.0.1-alpha.7"
|
version = "0.0.1-alpha.8"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package dev.frogmc.thyroxine;
|
package dev.frogmc.thyroxine;
|
||||||
|
|
||||||
import com.electronwill.nightconfig.json.JsonParser;
|
import com.electronwill.nightconfig.json.JsonParser;
|
||||||
|
import org.objectweb.asm.Opcodes;
|
||||||
|
|
||||||
public final class Constants {
|
public final class Constants {
|
||||||
public static final String VERSION_MANIFEST = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json";
|
public static final String VERSION_MANIFEST = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json";
|
||||||
public static final JsonParser JSON_PARSER = new JsonParser();
|
public static final JsonParser JSON_PARSER = new JsonParser();
|
||||||
|
public static final int ASM_VERSION = Opcodes.ASM9;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ import dev.frogmc.thyroxine.provider.ParchmentProvider;
|
||||||
import org.objectweb.asm.ClassReader;
|
import org.objectweb.asm.ClassReader;
|
||||||
import org.objectweb.asm.ClassVisitor;
|
import org.objectweb.asm.ClassVisitor;
|
||||||
import org.objectweb.asm.ClassWriter;
|
import org.objectweb.asm.ClassWriter;
|
||||||
import org.objectweb.asm.Opcodes;
|
|
||||||
import org.objectweb.asm.commons.ClassRemapper;
|
import org.objectweb.asm.commons.ClassRemapper;
|
||||||
|
|
||||||
public class Thyroxine {
|
public class Thyroxine {
|
||||||
|
@ -166,7 +165,7 @@ public class Thyroxine {
|
||||||
byte[] bytes = Files.readAllBytes(path);
|
byte[] bytes = Files.readAllBytes(path);
|
||||||
ClassReader reader = new ClassReader(bytes);
|
ClassReader reader = new ClassReader(bytes);
|
||||||
List<String> superTypes = new ArrayList<>();
|
List<String> superTypes = new ArrayList<>();
|
||||||
reader.accept(new ClassVisitor(Opcodes.ASM9) {
|
reader.accept(new ClassVisitor(Constants.ASM_VERSION) {
|
||||||
@Override
|
@Override
|
||||||
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
|
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
|
||||||
superTypes.add(superName);
|
superTypes.add(superName);
|
||||||
|
|
|
@ -3,11 +3,11 @@ package dev.frogmc.thyroxine.api;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import dev.frogmc.thyroxine.Constants;
|
||||||
import dev.frogmc.thyroxine.api.data.MappingData;
|
import dev.frogmc.thyroxine.api.data.MappingData;
|
||||||
import dev.frogmc.thyroxine.api.data.Member;
|
import dev.frogmc.thyroxine.api.data.Member;
|
||||||
import org.objectweb.asm.ClassVisitor;
|
import org.objectweb.asm.ClassVisitor;
|
||||||
import org.objectweb.asm.MethodVisitor;
|
import org.objectweb.asm.MethodVisitor;
|
||||||
import org.objectweb.asm.Opcodes;
|
|
||||||
import org.objectweb.asm.commons.ClassRemapper;
|
import org.objectweb.asm.commons.ClassRemapper;
|
||||||
import org.objectweb.asm.commons.Remapper;
|
import org.objectweb.asm.commons.Remapper;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ public class ParameterClassRemapper extends ClassRemapper {
|
||||||
private final MappingData data;
|
private final MappingData data;
|
||||||
|
|
||||||
public ParameterClassRemapper(ClassVisitor classVisitor, Remapper remapper, MappingData data) {
|
public ParameterClassRemapper(ClassVisitor classVisitor, Remapper remapper, MappingData data) {
|
||||||
super(Opcodes.ASM9, classVisitor, remapper);
|
super(Constants.ASM_VERSION, classVisitor, remapper);
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
package dev.frogmc.thyroxine.api;
|
package dev.frogmc.thyroxine.api;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.HashSet;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import dev.frogmc.thyroxine.Constants;
|
||||||
import org.objectweb.asm.Label;
|
import org.objectweb.asm.Label;
|
||||||
import org.objectweb.asm.MethodVisitor;
|
import org.objectweb.asm.MethodVisitor;
|
||||||
import org.objectweb.asm.Opcodes;
|
|
||||||
import org.objectweb.asm.Type;
|
import org.objectweb.asm.Type;
|
||||||
import org.objectweb.asm.commons.MethodRemapper;
|
import org.objectweb.asm.commons.MethodRemapper;
|
||||||
import org.objectweb.asm.commons.Remapper;
|
import org.objectweb.asm.commons.Remapper;
|
||||||
|
@ -14,7 +17,7 @@ public class ParameterMethodRemapper extends MethodRemapper {
|
||||||
private final Set<String> usedLocalNames = new HashSet<>();
|
private final Set<String> usedLocalNames = new HashSet<>();
|
||||||
|
|
||||||
public ParameterMethodRemapper(MethodVisitor methodVisitor, Remapper remapper, Map<Integer, String> parameters) {
|
public ParameterMethodRemapper(MethodVisitor methodVisitor, Remapper remapper, Map<Integer, String> parameters) {
|
||||||
super(Opcodes.ASM9, methodVisitor, remapper);
|
super(Constants.ASM_VERSION, methodVisitor, remapper);
|
||||||
this.parameters = parameters;
|
this.parameters = parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,6 +163,14 @@ public record MappingBundle(List<MappingData> data, List<DocumentationData> docu
|
||||||
String w = res;
|
String w = res;
|
||||||
res = d.classes().get(res);
|
res = d.classes().get(res);
|
||||||
if (res == null) {
|
if (res == null) {
|
||||||
|
int dollar = w.indexOf("$");
|
||||||
|
if (dollar != -1) {
|
||||||
|
String prefix = d.classes().get(w.substring(0, dollar));
|
||||||
|
if (prefix != null) {
|
||||||
|
res = prefix + w.substring(dollar);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!allowIncomplete) {
|
if (!allowIncomplete) {
|
||||||
/*
|
/*
|
||||||
* The mapping set is incomplete at this point.
|
* The mapping set is incomplete at this point.
|
||||||
|
|
Loading…
Reference in a new issue