Lorenzo0111 / QualityArmory

A quality gun plugin similar to CrackShot.
GNU General Public License v3.0
95 stars 50 forks source link

[Bug]: Internal error on Minecraft spigot 1.21 #579

Closed Nitrowut closed 2 months ago

Nitrowut commented 3 months ago

Confirmations

What happened?

When I try to give gun with /qa give ak47 then I got this error (In screenshot) image

But when I try to give ammo it's wotking.

Full error in Console:

[16:12:24] [Server thread/INFO]: suklaatorakka issued server command: /qa give ak47
[16:12:25] [Server thread/INFO]: [QualityArmory] [NBTAPI] Found Minecraft: v1_21_R1! Trying to find NMS support
[16:12:25] [Server thread/INFO]: [QualityArmory] [NBTAPI] Found Minecraft: 1.21! Trying to find NMS support
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] This Server-Version(1.21-R0.1-SNAPSHOT) is not supported by this NBT-API Version(2.12.4) located in QualityArmory. The NBT-API will try to work as good as it can! Some functions may not work!
[16:12:25] [Server thread/INFO]: [QualityArmory] [NBTAPI] Using the plugin 'QualityArmory' to create a bStats instance!
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedreadCompressed(java.io.InputStream,net.minecraft.nbt.NbtAccounter)' in 'NBTCompressedStreamTools' Args: [class java.io.InputStream, class net.minecraft.nbt.NBTReadLimiter] Enum: NBTFILE_READV2
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedunlimitedHeap()' in 'NBTReadLimiter' Args: [] Enum: NBTACCOUNTER_CREATE_UNLIMITED
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'Unmappedget(net.minecraft.core.component.DataComponentType)' in 'DataComponentHolder' Args: [interface net.minecraft.core.component.DataComponentType] Enum: NMSDATACOMPONENTHOLDER_GET
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedcopyTag()' in 'CustomData' Args: [] Enum: NMSCUSTOMDATA_GETCOPY
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'Unmappedset(net.minecraft.core.component.DataComponentType,java.lang.Object)' in 'ItemStack' Args: [interface net.minecraft.core.component.DataComponentType, class java.lang.Object] Enum: NMSITEM_SET
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'Unmappedsave(net.minecraft.core.HolderLookup$Provider)' in 'ItemStack' Args: [interface net.minecraft.core.HolderLookup$a] Enum: NMSITEM_SAVE_MODERN
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedparseOptional(net.minecraft.core.HolderLookup$Provider,net.minecraft.nbt.CompoundTag)' in 'ItemStack' Args: [interface net.minecraft.core.HolderLookup$a, class net.minecraft.nbt.NBTTagCompound] Enum: NMSITEM_LOAD
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedregistryAccess()' in 'MinecraftServer' Args: [] Enum: NMSSERVER_GETREGISTRYACCESS
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedsaveWithId(net.minecraft.core.HolderLookup$Provider)' in 'TileEntity' Args: [interface net.minecraft.core.HolderLookup$a] Enum: TILEENTITY_GET_NBT_1205
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedloadWithComponents(net.minecraft.nbt.CompoundTag,net.minecraft.core.HolderLookup$Provider)' in 'TileEntity' Args: [class net.minecraft.nbt.NBTTagCompound, interface net.minecraft.core.HolderLookup$a] Enum: TILEENTITY_SET_NBT_1205
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedgetDataFixer()' in 'DataConverterRegistry' Args: [] Enum: GET_DATAFIXER
[16:12:25] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'qa' in plugin QualityArmory v2.0.13
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-api-1.21-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:150) ~[spigot-api-1.21-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_21_R1.CraftServer.dispatchCommand(CraftServer.java:913) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at org.bukkit.craftbukkit.v1_21_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:50) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.a(SourceFile:29) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(SourceFile:13) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.execution.UnboundEntryAction.a(SourceFile:8) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.execution.CommandQueueEntry.a(SourceFile:8) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.execution.ExecutionContext.a(SourceFile:107) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.CommandDispatcher.a(CommandDispatcher.java:414) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.CommandDispatcher.performCommand(CommandDispatcher.java:336) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.CommandDispatcher.a(CommandDispatcher.java:323) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.network.PlayerConnection.b(PlayerConnection.java:1842) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.network.PlayerConnection.lambda$handleChatCommand$7(PlayerConnection.java:1818) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:162) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1270) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:203) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.util.thread.IAsyncTaskHandler.B(SourceFile:136) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.bv(MinecraftServer.java:1249) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.B(MinecraftServer.java:1242) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.util.thread.IAsyncTaskHandler.bB(SourceFile:121) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.v_(MinecraftServer.java:1213) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1078) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.ExceptionInInitializerError
        at me.zombie_striker.qg.nbt.NBTCompound.setInteger(NBTCompound.java:209) ~[?:?]
        at me.zombie_striker.qg.guns.Gun.lambda$updateAmmo$1(Gun.java:174) ~[?:?]
        at me.zombie_striker.qg.nbt.NBT.modify(NBT.java:204) ~[?:?]
        at me.zombie_striker.qg.guns.Gun.updateAmmo(Gun.java:173) ~[?:?]
        at me.zombie_striker.qg.QAMain.onCommand(QAMain.java:1624) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.21-R0.1-SNAPSHOT.jar:?]
        ... 27 more
Caused by: java.lang.NullPointerException
        at java.base/java.util.Objects.requireNonNull(Objects.java:233) ~[?:?]
        at java.base/java.lang.Class.getDeclaredField(Class.java:2774) ~[?:?]
        at me.zombie_striker.qg.nbt.NBTReflectionUtil.<clinit>(NBTReflectionUtil.java:59) ~[?:?]
        at me.zombie_striker.qg.nbt.NBTCompound.setInteger(NBTCompound.java:209) ~[?:?]
        at me.zombie_striker.qg.guns.Gun.lambda$updateAmmo$1(Gun.java:174) ~[?:?]
        at me.zombie_striker.qg.nbt.NBT.modify(NBT.java:204) ~[?:?]
        at me.zombie_striker.qg.guns.Gun.updateAmmo(Gun.java:173) ~[?:?]
        at me.zombie_striker.qg.QAMain.onCommand(QAMain.java:1624) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.21-R0.1-SNAPSHOT.jar:?]
        ... 27 more

Expected Behaviour

I expect to give gun working in minecraft spigot 1.21

Plugins

Quality Armory 2.0.13

Server Version

1.21 / [Server thread/INFO]: This server is running CraftBukkit version 4248-Spigot-491f367-ae4f5a0 (MC: 1.21) (Implementing API version 1.21-R0.1-SNAPSHOT)

Relevant log output

[16:12:24] [Server thread/INFO]: suklaatorakka issued server command: /qa give ak47
[16:12:25] [Server thread/INFO]: [QualityArmory] [NBTAPI] Found Minecraft: v1_21_R1! Trying to find NMS support
[16:12:25] [Server thread/INFO]: [QualityArmory] [NBTAPI] Found Minecraft: 1.21! Trying to find NMS support
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] This Server-Version(1.21-R0.1-SNAPSHOT) is not supported by this NBT-API Version(2.12.4) located in QualityArmory. The NBT-API will try to work as good as it can! Some functions may not work!
[16:12:25] [Server thread/INFO]: [QualityArmory] [NBTAPI] Using the plugin 'QualityArmory' to create a bStats instance!
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedreadCompressed(java.io.InputStream,net.minecraft.nbt.NbtAccounter)' in 'NBTCompressedStreamTools' Args: [class java.io.InputStream, class net.minecraft.nbt.NBTReadLimiter] Enum: NBTFILE_READV2
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedunlimitedHeap()' in 'NBTReadLimiter' Args: [] Enum: NBTACCOUNTER_CREATE_UNLIMITED
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'Unmappedget(net.minecraft.core.component.DataComponentType)' in 'DataComponentHolder' Args: [interface net.minecraft.core.component.DataComponentType] Enum: NMSDATACOMPONENTHOLDER_GET
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedcopyTag()' in 'CustomData' Args: [] Enum: NMSCUSTOMDATA_GETCOPY
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'Unmappedset(net.minecraft.core.component.DataComponentType,java.lang.Object)' in 'ItemStack' Args: [interface net.minecraft.core.component.DataComponentType, class java.lang.Object] Enum: NMSITEM_SET
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'Unmappedsave(net.minecraft.core.HolderLookup$Provider)' in 'ItemStack' Args: [interface net.minecraft.core.HolderLookup$a] Enum: NMSITEM_SAVE_MODERN
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedparseOptional(net.minecraft.core.HolderLookup$Provider,net.minecraft.nbt.CompoundTag)' in 'ItemStack' Args: [interface net.minecraft.core.HolderLookup$a, class net.minecraft.nbt.NBTTagCompound] Enum: NMSITEM_LOAD
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedregistryAccess()' in 'MinecraftServer' Args: [] Enum: NMSSERVER_GETREGISTRYACCESS
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedsaveWithId(net.minecraft.core.HolderLookup$Provider)' in 'TileEntity' Args: [interface net.minecraft.core.HolderLookup$a] Enum: TILEENTITY_GET_NBT_1205
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedloadWithComponents(net.minecraft.nbt.CompoundTag,net.minecraft.core.HolderLookup$Provider)' in 'TileEntity' Args: [class net.minecraft.nbt.NBTTagCompound, interface net.minecraft.core.HolderLookup$a] Enum: TILEENTITY_SET_NBT_1205
[16:12:25] [Server thread/WARN]: [QualityArmory] [NBTAPI] Unable to find the method 'UnmappedgetDataFixer()' in 'DataConverterRegistry' Args: [] Enum: GET_DATAFIXER
[16:12:25] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'qa' in plugin QualityArmory v2.0.13
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-api-1.21-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:150) ~[spigot-api-1.21-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_21_R1.CraftServer.dispatchCommand(CraftServer.java:913) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at org.bukkit.craftbukkit.v1_21_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:50) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.a(SourceFile:29) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(SourceFile:13) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.execution.UnboundEntryAction.a(SourceFile:8) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.execution.CommandQueueEntry.a(SourceFile:8) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.execution.ExecutionContext.a(SourceFile:107) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.CommandDispatcher.a(CommandDispatcher.java:414) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.CommandDispatcher.performCommand(CommandDispatcher.java:336) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.commands.CommandDispatcher.a(CommandDispatcher.java:323) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.network.PlayerConnection.b(PlayerConnection.java:1842) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.network.PlayerConnection.lambda$handleChatCommand$7(PlayerConnection.java:1818) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:162) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1270) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:203) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.util.thread.IAsyncTaskHandler.B(SourceFile:136) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.bv(MinecraftServer.java:1249) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.B(MinecraftServer.java:1242) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.util.thread.IAsyncTaskHandler.bB(SourceFile:121) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.v_(MinecraftServer.java:1213) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1078) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4248-Spigot-491f367-ae4f5a0]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.ExceptionInInitializerError
        at me.zombie_striker.qg.nbt.NBTCompound.setInteger(NBTCompound.java:209) ~[?:?]
        at me.zombie_striker.qg.guns.Gun.lambda$updateAmmo$1(Gun.java:174) ~[?:?]
        at me.zombie_striker.qg.nbt.NBT.modify(NBT.java:204) ~[?:?]
        at me.zombie_striker.qg.guns.Gun.updateAmmo(Gun.java:173) ~[?:?]
        at me.zombie_striker.qg.QAMain.onCommand(QAMain.java:1624) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.21-R0.1-SNAPSHOT.jar:?]
        ... 27 more
Caused by: java.lang.NullPointerException
        at java.base/java.util.Objects.requireNonNull(Objects.java:233) ~[?:?]
        at java.base/java.lang.Class.getDeclaredField(Class.java:2774) ~[?:?]
        at me.zombie_striker.qg.nbt.NBTReflectionUtil.<clinit>(NBTReflectionUtil.java:59) ~[?:?]
        at me.zombie_striker.qg.nbt.NBTCompound.setInteger(NBTCompound.java:209) ~[?:?]
        at me.zombie_striker.qg.guns.Gun.lambda$updateAmmo$1(Gun.java:174) ~[?:?]
        at me.zombie_striker.qg.nbt.NBT.modify(NBT.java:204) ~[?:?]
        at me.zombie_striker.qg.guns.Gun.updateAmmo(Gun.java:173) ~[?:?]
        at me.zombie_striker.qg.QAMain.onCommand(QAMain.java:1624) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.21-R0.1-SNAPSHOT.jar:?]
        ... 27 more
Lorenzo0111 commented 2 months ago

Fixed with 192fe1525c8ae93a5d4baa2210eb7d7903ec0a38