crashdemons / DisplayItem-Spigot

rewrite of DisplayItem for use in Spigot 1.13+ (uses BungeeChat components)
5 stars 0 forks source link

Exception with 1.17 #19

Closed crashdemons closed 2 years ago

crashdemons commented 3 years ago
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]: java.lang.ClassNotFoundException: net.minecraft.server.v1_17_R1.ItemStack
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:142)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.lang.Class.forName0(Native Method)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.lang.Class.forName(Class.java:375)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.ReflectionUtil.getNMSClass(ReflectionUtil.java:77)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.ItemConverter.convertItemStackToJson(ItemConverter.java:33)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.HoverComponentManager.getTooltipComponent(HoverComponentManager.java:51)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.HoverComponentManager.getTooltipComponent(HoverComponentManager.java:47)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.MessageFormatter.formatItemComponents(MessageFormatter.java:47)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.MessageFormatter.messageInsertItem(MessageFormatter.java:71)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatLineFormatter.chatLineInsertItem(ChatLineFormatter.java:49)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.replaceItem(ChatEventExecutor.java:82)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.onChatInternal(ChatEventExecutor.java:117)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.onChatBukkit(ChatEventExecutor.java:87)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.execute(ChatEventExecutor.java:56)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:1866)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1800)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1766)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.network.protocol.game.PacketPlayInChat$1.run(PacketPlayInChat.java:40)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.lang.Thread.run(Thread.java:831)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]: java.lang.ClassNotFoundException: net.minecraft.server.v1_17_R1.NBTTagCompound
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:142)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.lang.Class.forName0(Native Method)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.lang.Class.forName(Class.java:375)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.ReflectionUtil.getNMSClass(ReflectionUtil.java:77)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.ItemConverter.convertItemStackToJson(ItemConverter.java:34)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.HoverComponentManager.getTooltipComponent(HoverComponentManager.java:51)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.HoverComponentManager.getTooltipComponent(HoverComponentManager.java:47)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.MessageFormatter.formatItemComponents(MessageFormatter.java:47)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.MessageFormatter.messageInsertItem(MessageFormatter.java:71)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatLineFormatter.chatLineInsertItem(ChatLineFormatter.java:49)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.replaceItem(ChatEventExecutor.java:82)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.onChatInternal(ChatEventExecutor.java:117)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.onChatBukkit(ChatEventExecutor.java:87)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.execute(ChatEventExecutor.java:56)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:1866)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1800)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1766)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.network.protocol.game.PacketPlayInChat$1.run(PacketPlayInChat.java:40)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.lang.Thread.run(Thread.java:831)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]: java.lang.NullPointerException: Cannot invoke "java.lang.Class.getMethod(String, java.lang.Class[])" because "clazz" is null
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.ReflectionUtil.getMethod(ReflectionUtil.java:170)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.ItemConverter.convertItemStackToJson(ItemConverter.java:35)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.HoverComponentManager.getTooltipComponent(HoverComponentManager.java:51)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.libraries.sainttx.HoverComponentManager.getTooltipComponent(HoverComponentManager.java:47)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.MessageFormatter.formatItemComponents(MessageFormatter.java:47)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.MessageFormatter.messageInsertItem(MessageFormatter.java:71)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatLineFormatter.chatLineInsertItem(ChatLineFormatter.java:49)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.replaceItem(ChatEventExecutor.java:82)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.onChatInternal(ChatEventExecutor.java:117)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.onChatBukkit(ChatEventExecutor.java:87)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.execute(ChatEventExecutor.java:56)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:1866)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1800)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1766)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at net.minecraft.network.protocol.game.PacketPlayInChat$1.run(PacketPlayInChat.java:40)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/WARN]:    at java.base/java.lang.Thread.run(Thread.java:831)
[13.06 10:28:00] [Server] [Async Chat Thread - #0/ERROR]: failed to serialize itemstack to nms item
[13.06 10:28:00] [Server] java.lang.NullPointerExceptionCannot invoke "java.lang.Class.newInstance()" because "nbtTagCompoundClazz" is null
[13.06 10:28:00] [Server]   at com.github.crashdemons.displayitem_spigot.libraries.sainttx.ItemConverter.convertItemStackToJson(ItemConverter.java:42) [DisplayItem-Spigot-2.9.5-SNAPSHOT.jar:?]
[13.06 10:28:00] [Server]   at com.github.crashdemons.displayitem_spigot.libraries.sainttx.HoverComponentManager.getTooltipComponent(HoverComponentManager.java:51) [DisplayItem-Spigot-2.9.5-SNAPSHOT.jar:?]
[13.06 10:28:00] [Server]   at com.github.crashdemons.displayitem_spigot.libraries.sainttx.HoverComponentManager.getTooltipComponent(HoverComponentManager.java:47) [DisplayItem-Spigot-2.9.5-SNAPSHOT.jar:?]
[13.06 10:28:00] [Server]   at com.github.crashdemons.displayitem_spigot.chat.MessageFormatter.formatItemComponents(MessageFormatter.java:47) [DisplayItem-Spigot-2.9.5-SNAPSHOT.jar:?]
[13.06 10:28:00] [Server]   at com.github.crashdemons.displayitem_spigot.chat.MessageFormatter.messageInsertItem(MessageFormatter.java:71) [DisplayItem-Spigot-2.9.5-SNAPSHOT.jar:?]
[13.06 10:28:00] [Server]   at com.github.crashdemons.displayitem_spigot.chat.ChatLineFormatter.chatLineInsertItem(ChatLineFormatter.java:49) [DisplayItem-Spigot-2.9.5-SNAPSHOT.jar:?]
[13.06 10:28:00] [Server]   at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.replaceItem(ChatEventExecutor.java:82) [DisplayItem-Spigot-2.9.5-SNAPSHOT.jar:?]
[13.06 10:28:00] [Server]   at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.onChatInternal(ChatEventExecutor.java:117) [DisplayItem-Spigot-2.9.5-SNAPSHOT.jar:?]
[13.06 10:28:00] [Server]   at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.onChatBukkit(ChatEventExecutor.java:87) [DisplayItem-Spigot-2.9.5-SNAPSHOT.jar:?]
[13.06 10:28:00] [Server]   at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.execute(ChatEventExecutor.java:56) [DisplayItem-Spigot-2.9.5-SNAPSHOT.jar:?]
[13.06 10:28:00] [Server]   at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) [spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
[13.06 10:28:00] [Server]   at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) [spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
[13.06 10:28:00] [Server]   at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) [spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
[13.06 10:28:00] [Server]   at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:1866) [spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
[13.06 10:28:00] [Server]   at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1800) [spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
[13.06 10:28:00] [Server]   at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1766) [spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
crashdemons commented 3 years ago

Looking at a decompile of spigot 1.17, I don't even see the version-namespace in NMS

This server is running CraftBukkit version 3124-Spigot-66f9d3c-384e116 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT)

crashdemons commented 3 years ago

According to the statement by md_5, these version-specific NMS classes will not be deobfuscated anymore on Spigot and so these features (serializing items to NBT for hover) cannot be done using this method in 1.17

https://www.spigotmc.org/threads/spigot-bungeecord-1-17.510208/

crashdemons commented 3 years ago

should be temporarily fixed by 29fa422c3123e4f171d4519878c3da952f2d2f33