tiny-remapper icon indicating copy to clipboard operation
tiny-remapper copied to clipboard

It doesn't remap field and method name inside a method.

Open heipiao233 opened this issue 2 years ago • 8 comments

Args: "in.jar out.jar mappings.tiny intermediary named --threads=8"

heipiao233 avatar May 24 '22 12:05 heipiao233

Why not get field and method name from mappings, not classpath?

heipiao233 avatar May 24 '22 12:05 heipiao233

I encountered the same problem when developing a mod named "Voxel Latest" to enable Voxelmap to work in minecraft 1.18 or higher.

Here is my command line: ["C:<hidden>\modDev\voxelremap 1.18.2\run\voxelmap\fabricmod_VoxelMap-1.10.15_for_1.17.0.jar", "C:<hidden>\modDev\voxelremap 1.18.2\run\voxellatest\remapped.jar", "C:<hidden>\modDev\voxelremap 1.18.2\run\voxellatest\yarn-1.17.tiny", "intermediary", "named", "--mixin"].

I promise that my .tiny file is not broken. But Tiny Remapper didn't remap any INVOKESTATIC or INVOKEVIRTUAL instructions.

For example, class_310.method_1551 is remapped into MinecraftClient.method_1551 instead of MinecraftClient.getInstance() I expected.

I'm not sure whether it is a Bug or a strange feature. Is there any Remapper which could correctly remap method name ?

My .tiny file is downloaded from "https://maven.fabricmc.net/net/fabricmc/yarn/1.17+build.13/yarn-1.17+build.13-tiny.gz".

Don't worry, I have already decompressed the gz file.

burningtnt avatar Jan 28 '23 08:01 burningtnt

This is to be expected if you don't have at least Minecraft on the tr class path for analysis - mappings only have an effect if they target a class TR knows about.

sfPlayer1 avatar Jan 28 '23 18:01 sfPlayer1

This is to be expected if you don't have at least Minecraft on the tr class path for analysis - mappings only have an effect if they target a class TR knows about.

How would a person put minecraft on the classpath?

cph101 avatar Feb 17 '24 14:02 cph101

Yes, it works. By the way, I found it work as well by directly invoking the methods inside and pass in the location of minecraft jar.

burningtnt avatar Feb 17 '24 14:02 burningtnt

Which minecraft jar? The one generated by loom? or remappedClasspath.txt?? Neither seem to work

cph101 avatar Feb 22 '24 08:02 cph101

Which minecraft jar? The one generated by loom? or remappedClasspath.txt?? Neither seem to work

This depends on the namespace.

  • yarn -> intermediary: The minecraft jar in yarn namespace.
  • intermediary -> yarn: The minecraft jar in intermediary namespace.

burningtnt avatar Feb 22 '24 09:02 burningtnt

Yes, it works. By the way, I found it work as well by directly invoking the methods inside and pass in the location of minecraft jar.

Just reread this. I’m not sure that it’s practical to directly invoke all the fields and methods from a mod I’m trying to decompile which has over a thousand different method calls, all on their own locally-defined variable though??

cph101 avatar Mar 01 '24 18:03 cph101