ds58 / Panilla

Prevent abusive NBT and crash packets on a Minecraft server
MIT License
149 stars 40 forks source link

Server crashes when connecting to a player with bundle #119

Closed fadfhkdfga closed 1 year ago

fadfhkdfga commented 1 year ago

We are a creative server (version 1.18.2) that allows you to freely craft items and import them into the hotbar.

As I expected, it seems that the server crash occurs because the player has the 'bundle' item. (+ There are many bows in the bundle)

Request to add features such as automatic deletion of bundle items that cannot be used in version 1.18.2.

Below is a link to download player data for users who experience crashes when connecting.

playerdata download

CRASH LOG: Description: Ticking player

java.lang.IllegalArgumentException: item is null or air at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) at org.bukkit.craftbukkit.v1_18_R2.inventory.CraftMetaBundle.addItem(CraftMetaBundle.java:132) at org.bukkit.craftbukkit.v1_18_R2.inventory.CraftMetaBundle.(CraftMetaBundle.java:52) at org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack.getItemMeta(CraftItemStack.java:514) at org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack.getItemMeta(CraftItemStack.java:283) at org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack.getItemMeta(CraftItemStack.java:275) at net.minecraft.world.entity.LivingEntity.sanitizeItemStack(LivingEntity.java:3159) at net.minecraft.world.entity.LivingEntity.lambda$handleEquipmentChanges$6(LivingEntity.java:3081) at java.base/java.util.Map.forEach(Map.java:713) at net.minecraft.world.entity.LivingEntity.handleEquipmentChanges(LivingEntity.java:3077) at net.minecraft.world.entity.LivingEntity.detectEquipmentUpdates(LivingEntity.java:3005) at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:2907) at net.minecraft.world.entity.player.Player.tick(Player.java:269) at net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:668) at net.minecraft.server.players.PlayerList.remove(PlayerList.java:620) at net.minecraft.server.players.PlayerList.remove(PlayerList.java:602) at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2010) at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:1990) at net.minecraft.network.Connection.handleDisconnection(Connection.java:753) at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:251) at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1623) at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:483) at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1456) at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1226) at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) at java.base/java.lang.Thread.run(Thread.java:833)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head -- Thread: Server thread Stacktrace: at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) at org.bukkit.craftbukkit.v1_18_R2.inventory.CraftMetaBundle.addItem(CraftMetaBundle.java:132) at org.bukkit.craftbukkit.v1_18_R2.inventory.CraftMetaBundle.(CraftMetaBundle.java:52) at org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack.getItemMeta(CraftItemStack.java:514) at org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack.getItemMeta(CraftItemStack.java:283) at org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack.getItemMeta(CraftItemStack.java:275) at net.minecraft.world.entity.LivingEntity.sanitizeItemStack(LivingEntity.java:3159) at net.minecraft.world.entity.LivingEntity.lambda$handleEquipmentChanges$6(LivingEntity.java:3081) at java.base/java.util.Map.forEach(Map.java:713) at net.minecraft.world.entity.LivingEntity.handleEquipmentChanges(LivingEntity.java:3077) at net.minecraft.world.entity.LivingEntity.detectEquipmentUpdates(LivingEntity.java:3005) at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:2907) at net.minecraft.world.entity.player.Player.tick(Player.java:269)

-- Player being ticked -- Details: Entity Type: minecraft:player (net.minecraft.server.level.EntityPlayer) Entity ID: 133054 Entity Name: Anonymous Entity's Exact location: 3949980.77, 9.00, -850063.73 Entity's Block location: World: (3949980,9,-850064), Section: (at 12,9,0 in 246873,0,-53129; chunk contains blocks 3949968,-64,-850064 to 3949983,319,-850049), Region: (7714,-1661; contains chunks 246848,-53152 to 246879,-53121, blocks 3949568,-64,-850432 to 3950079,319,-849921) Entity's Momentum: 0.00, 0.00, 0.00 Entity's Passengers: [] Entity's Vehicle: null Stacktrace: at net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:668) at net.minecraft.server.players.PlayerList.remove(PlayerList.java:620) at net.minecraft.server.players.PlayerList.remove(PlayerList.java:602) at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2010) at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:1990) at net.minecraft.network.Connection.handleDisconnection(Connection.java:753) at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:251) at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1623) at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:483) at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1456) at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1226) at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) at java.base/java.lang.Thread.run(Thread.java:833)

ds58 commented 1 year ago

Thanks for reporting, I'll take a look at this soon

ds58 commented 1 year ago

Fixed in 1.8.2. New release on SpigotMC