fix more remapping bugs
All checks were successful
Publish to snapshot maven / build (push) Successful in 19s

This commit is contained in:
moehreag 2024-07-08 16:42:28 +02:00
parent 69b62e7d0e
commit 2d524c0eea
4 changed files with 15 additions and 12 deletions

View file

@ -8,7 +8,7 @@ plugins {
}
group = "dev.frogmc"
version = "0.0.1-alpha.8"
version = "0.0.1-alpha.9"
repositories {
mavenCentral()

View file

@ -73,8 +73,9 @@ public class Thyroxine {
List<Callable<Void>> tasks = new ArrayList<>();
Map<String, List<String>> lazyParents = new ConcurrentHashMap<>();
MappingData reverseData = data.reverse();
Mapper mapper = new Mapper(data, className -> lazyParents.computeIfAbsent(className, ignored ->
Thyroxine.computeInheritances(className, inFs)));
computeInheritances(className, inFs, reverseData)));
Files.walkFileTree(inFs.getPath("/"), new SimpleFileVisitor<>() {
@ -156,8 +157,11 @@ public class Thyroxine {
return false;
}
private static List<String> computeInheritances(String className, FileSystem inFs) {
private static List<String> computeInheritances(String className, FileSystem inFs, MappingData reverse) {
try {
if (reverse.classes().containsKey(className)) {
className = reverse.classes().get(className);
}
Path path = inFs.getPath("/" + className + ".class");
if (!Files.isRegularFile(path))
return List.of();
@ -168,8 +172,12 @@ public class Thyroxine {
reader.accept(new ClassVisitor(Constants.ASM_VERSION) {
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
superTypes.add(superName);
superTypes.addAll(Arrays.asList(interfaces));
if (interfaces != null) {
superTypes.addAll(Arrays.asList(interfaces));
}
if (!"java/lang/Object".equals(superName)) {
superTypes.add(superName);
}
}
}, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);

View file

@ -60,9 +60,4 @@ public class Mapper extends Remapper {
return null;
}
@Override
public String mapMethodDesc(String methodDescriptor) {
return super.mapMethodDesc(methodDescriptor);
}
}

View file

@ -43,9 +43,9 @@ public class TinyV2Parser {
if ("c".equals(line[0])) {
if (1+ns >= line.length) {
do {
while (lines[i + 1].startsWith("\t")) {
i++;
} while (lines[i].startsWith("\t"));
}
continue;
}
currentClass = line[ns];