Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6550

Some Spigot mappings are not applied when remapped

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • This server is running CraftBukkit version 3133-Spigot-66f9d3c-3fa79d3 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT)
    • Yes

      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 could imagine there are more mappings affected by this.

      I've made a simple test plugin with just the code above and maven.

            Unassigned Unassigned
            WolfyScript Gunnar
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: