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

Parameter names in overridden methods don't propagate sometimes

Open jaskarth opened this issue 4 years ago • 1 comments

The parameter names of overriden methods don't have any names, even when the mappings say that they should. For example, the BlockPos constructor is

public BlockPos(int i, int j, int k) {
      super(i, j, k);
}

when it should be x, y, z. The mappings are correct when viewing with enigma. As another example, the abstract method in Carver is this public abstract boolean carve(Chunk chunk, Function<BlockPos, Biome> posToBiome, Random random, int seaLevel, int chunkX, int chunkZ, int mainChunkX, int mainChunkZ, BitSet carvingMask, C carverConfig); while the overriden method in CaveCarver is public boolean carve(Chunk chunk, Function<BlockPos, Biome> function, Random random, int i, int j, int k, int l, int m, BitSet bitSet, ProbabilityConfig probabilityConfig) {. It doesn't have any mappings when it should, as seen in enigma.

The strange thing about this issue is that it only happens to some methods, but not all of them. I would really appreciate this issue being fixed as it would make viewing the source much easier 😅

jaskarth avatar Dec 22 '20 16:12 jaskarth

For <init> there's no virtual method dispatch, but chaining, thus I'd only want to do this if some special option is enabled (optimistically assume identical constructor signatures take the same named args). A proper solution would be determining the relationship by noticing the 1:1 pass-through to the super call, but this is matcher analysis level territory at least.

Other methods should be easy-ish. I want to change how TR holds mapping references (inside its model instead of the hash maps), which should then make it rather simple to resolve.

sfPlayer1 avatar Dec 22 '20 17:12 sfPlayer1