[SPIGOT-6550] Some Spigot mappings are not applied when remapped Created: 13/Jun/21 Updated: 22/Nov/21 Resolved: 22/Nov/21 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Gunnar | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Version: | This server is running CraftBukkit version 3133-Spigot-66f9d3c-3fa79d3 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT) | ||||||||||||
| Guidelines Read: | Yes | ||||||||||||
| Description |
|
When working with the new Mojang mappings and the specialsource-maven-plugin I came across some issues. Some methods are not mapped correctly to the Spigot mappings. var listTag = new net.minecraft.nbt.ListTag(); //These methods work fine listTag.add(net.minecraft.nbt.IntTag.valueOf(10)); listTag.addTag(0, net.minecraft.nbt.IntTag.valueOf(11)); //Missing method listTag.add(0, net.minecraft.nbt.IntTag.valueOf(12)); //Should return 10 but method cannot be found getLogger().info(() -> listTag.get(0).toString()); For example the net.minecraft.nbt.ListTag.add(int, Tag)The method as in the Spigot-mappings:
net.minecraft.nbt.NBTTagList.add(int, net.minecraft.nbt.NBTBase)
Actual remapped method using maven plugin:
net.minecraft.nbt.NBTTagList.c(int, net.minecraft.nbt.NBTBase)
Which of course throws a NoSuchMethodError https://pastebin.com/WGjZT5Vz Maybe it's because they have the same name in the Mojang and Spigot mappings? I've made a simple test plugin with just the code above and maven. |
| Comments |
| Comment by LoneDev [ 22/Nov/21 ] |
|
Thanks a lot @md_5 ! |
| Comment by md_5 [ 22/Nov/21 ] |
|
Resolved in 1.18 |
| Comment by md_5 [ 28/Jun/21 ] |
|
> I think that SpecialSource must implement something to index other jars (like Proguard does) so that it won't remap inherited methods from base classes, but this is easier to say than to implement for sure. It does, see the remappedDependencies in the 1.17 thread. This issue is separate. |
| Comment by LoneDev [ 28/Jun/21 ] |
|
I have the same issue, this is an interesting task.
Is there any workaround? |
| Comment by md_5 [ 13/Jun/21 ] |
|
This is a difficult one. I suspect it is because the methods are inherited from AbstractList and therefore synthetic; and SS-2 which is used in the Spigot decompile process does some automated remapping of synthetic methods that aren't included in the map files (to prevent decompile errors in many many classes due to our partial mapping). The only fix I can think of right now is adding those synthetic maps to the mapping file (easy), but then there is still the difficulty of making it work without introducing extra invocations of SpecialSource as part of the plugin build (not even sure if avoiding this is reasonably possible). tl;dr hard issue |