zlataovce / takenaka

A Kotlin library for reconciling multiple obfuscation mapping files from multiple versions of Minecraft: JE.
Apache License 2.0
51 stars 3 forks source link

Premature end of member ancestry nodes in a missing and mismatching name scenario #28

Closed zlataovce closed 1 year ago

zlataovce commented 1 year ago

This issue can be observed frequently with the usual Mojang, Spigot, Yarn, Intermediary, Searge mapping set in the 1.8.8-1.9 range.

An example on the CombatTracker#getDeathMessage method:

1.8.8
SEARGE: func_151521_b ()Lnet/minecraft/util/IChatComponent;
SPIGOT: no mapping (descriptor would be ()Lnet/minecraft/server/VVV/IChatBaseComponent;)

1.9
SEARGE: func_151521_b ()Lnet/minecraft/util/text/ITextComponent;
SPIGOT: getDeathMessage ()Lnet/minecraft/server/VVV/IChatBaseComponent;

or the Entity#load method:

1.13.2
SEARGE: func_70020_e (Lnet/minecraft/nbt/NBTTagCompound;)V
SPIGOT: no mapping (descriptor would be (Lnet/minecraft/server/VVV/NBTTagCompound;)V)

1.14
SEARGE: func_70020_e (Lnet/minecraft/nbt/CompoundNBT;)V
SPIGOT: no mapping (descriptor would be (Lnet/minecraft/server/VVV/NBTTagCompound;)V)
INTERMEDIARY: method_5651 (Lnet/minecraft/class_2487;)V

This can be solved by providing a function to supply an arbitrary amount of name-descriptor mapping pairs to a type during the ancestry computation process, for example, a function that creates a pair of a Searge name and a Spigot-mapped descriptor, allowing the aforementioned methods to be joined correctly using the existing logic:

(SYNTHETIC is the provided Searge-Spigot name pair)

1.8.8
SEARGE: func_151521_b ()Lnet/minecraft/util/IChatComponent;
SPIGOT: no mapping (descriptor would be ()Lnet/minecraft/server/VVV/IChatBaseComponent;)
SYNTHETIC: func_151521_b ()Lnet/minecraft/server/VVV/IChatBaseComponent; <-- matching name pair

1.9
SEARGE: func_151521_b ()Lnet/minecraft/util/text/ITextComponent;
SPIGOT: getDeathMessage ()Lnet/minecraft/server/VVV/IChatBaseComponent;
SYNTHETIC: func_151521_b ()Lnet/minecraft/server/VVV/IChatBaseComponent; <-- matching name pair
1.13.2
SEARGE: func_70020_e (Lnet/minecraft/nbt/NBTTagCompound;)V
SPIGOT: no mapping (descriptor would be (Lnet/minecraft/server/VVV/NBTTagCompound;)V)
SYNTHETIC: func_70020_e (Lnet/minecraft/server/VVV/NBTTagCompound;)V <-- matching name pair

1.14
SEARGE: func_70020_e (Lnet/minecraft/nbt/CompoundNBT;)V
SPIGOT: no mapping (descriptor would be (Lnet/minecraft/server/VVV/NBTTagCompound;)V)
INTERMEDIARY: method_5651 (Lnet/minecraft/class_2487;)V
SYNTHETIC: func_70020_e (Lnet/minecraft/server/VVV/NBTTagCompound;)V <-- matching name pair