LoneDev6 / FastNBT

Spigot library to edit items NBT very fast.
Apache License 2.0
8 stars 0 forks source link

1.16.5 - NoSuchMethodError: "net.minecraft.item.ItemStack.fromCompound(net.minecraft.nbt.CompoundNBT)" #4

Closed LoneDev6 closed 6 months ago

LoneDev6 commented 8 months ago

https://github.com/PluginBugs/Issues-ItemsAdder/issues/3421

Discord tag (optional)

pokesantitw

What happened?

Can't remove custom music disc created with ItemsAdder from the jukebox. If I break the jukebox, the console starts spamming warnings.

Steps to reproduce the issue

  1. Create a Custom Music Disc.
  2. Give yourself the music disc with /iagive
  3. Put the music disc in the jukebox. The music starts playing normally
  4. When you try to remove the disc, the error appears. The music stop. The note particle are still coming from the jukebox.

Server version

Arclight version arclight-1.16.5-1.0.25-SNAPSHOT-eea2c2bb (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)

ItemsAdder Version

ItemsAdder version 3.6.3-beta-11

ProtocolLib Version

ProtocolLib version 5.1.0-SNAPSHOT-660

LoneLibs Version

LoneLibs version 1.0.45

FULL server log

No response

Error (optional)

[10Feb2024 20:34:48.686] [Server thread/ERROR] [Minecraft/]: Could not pass event PlayerInteractEvent to ItemsAdder v3.6.3-beta-11
org.bukkit.event.EventException: null
  at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[arclight:arclight-1.16.5-1.0.25-SNAPSHOT-eea2c2bb]
  at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[arclight:arclight-1.16.5-1.0.25-SNAPSHOT-eea2c2bb]
  at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[arclight:arclight-1.16.5-1.0.25-SNAPSHOT-eea2c2bb]
  at org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactoryMixin.java:494) ~[arclight:arclight-1.16.5-1.0.25-SNAPSHOT-eea2c2bb]
  at net.minecraft.server.management.PlayerInteractionManager.func_219441_a(PlayerInteractionManagerMixin.java:748) ~[?:?]
  at net.minecraft.network.play.ServerPlayNetHandler.func_184337_a(ServerPlayNetHandlerMixin.java:958) ~[?:?]
  at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.func_148833_a(CPlayerTryUseItemOnBlockPacketMixin.java:36) ~[?:?]
  at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.func_148833_a(CPlayerTryUseItemOnBlockPacketMixin.java:10) ~[?:?]
  at net.minecraft.network.PacketThreadUtil.md1b48ce$lambda$checkThreadAndEnqueue$0$0(PacketThreadUtilMixin.java:536) ~[?:?]
  at net.minecraft.util.concurrent.TickDelayedTask.run(SourceFile:18) ~[?:?]
  at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144) ~[?:?]
  at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23) ~[?:?]
  at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServerMixin.java:734) ~[?:?]
  at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServerMixin.java:159) ~[?:?]
  at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118) ~[?:?]
  at net.minecraft.server.MinecraftServer.func_213205_aW(MinecraftServerMixin.java:717) ~[?:?]
  at net.minecraft.server.MinecraftServer.func_213168_p(MinecraftServerMixin.java:711) ~[?:?]
  at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213161_c(SourceFile:127) ~[?:?]
  at net.minecraft.server.MinecraftServer.func_213202_o(MinecraftServerMixin.java:697) ~[?:?]
  at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServerMixin.java:1921) ~[?:?]
  at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServerMixin.java:232) ~[?:?]
  at java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: java.lang.NoSuchMethodError: 'net.minecraft.item.ItemStack net.minecraft.item.ItemStack.fromCompound(net.minecraft.nbt.CompoundNBT)'
  at lonelibs.dev.lone.fastnbt.nms.nbt.CraftItemStack_v1_16_R3.compoundToItemStack(CraftItemStack_v1_16_R3.java:359) ~[?:?]
  at lonelibs.dev.lone.fastnbt.nms.nbt.CraftItemStack_v1_16_R3.compoundStrToBukkit(CraftItemStack_v1_16_R3.java:376) ~[?:?]
  at lonelibs.dev.lone.fastnbt.nms.nbt.NItem.compoundStrToBukkitItem(NItem.java:168) ~[?:?]
  at ia.m.dj.a(SourceFile:328) ~[?:?]
  at ia.m.cc.a(SourceFile:163) ~[?:?]
  at ia.m.cc.a(SourceFile:133) ~[?:?]
  ... 22 more

Problematic items yml configuration file (optional)

info:
  namespace: sonidos
items:
  music_disc_vsghechis:
    display_name: "Disco de música"
    lore:
    - '&7Pokémon - Vs Ghechis'
    resource:
      material: PAPER
      generate: true
      textures:
      - items/music_discs/music_disc_gen5.png
    behaviours:
      music_disc:
        song:
          name: sonidos:musica.vsghechis
          description: Pokémon - Vs Ghechis