FabricMC / tiny-remapper

Tiny JAR remapping tool.
GNU Lesser General Public License v3.0
115 stars 65 forks source link

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

Open heipiao233 opened 2 years ago

heipiao233 commented 2 years ago

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

heipiao233 commented 2 years ago

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

burningtnt commented 1 year ago

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:\\modDev\voxelremap 1.18.2\run\voxelmap\fabricmod_VoxelMap-1.10.15_for_1.17.0.jar", "C:\\modDev\voxelremap 1.18.2\run\voxellatest\remapped.jar", "C:\\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.

sfPlayer1 commented 1 year ago

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.

cph101 commented 9 months ago

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?

burningtnt commented 9 months ago

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.

cph101 commented 9 months ago

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

burningtnt commented 9 months ago

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

This depends on the namespace.

cph101 commented 8 months ago

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??