mirror of
https://github.com/PaperMC/Paper.git
synced 2025-04-01 12:11:45 +02:00
Fix loading Items entities with an invalid item. Addresses BUKKIT-3249
This commit is contained in:
parent
118682ce5c
commit
f71be2506d
1 changed files with 12 additions and 1 deletions
|
@ -195,7 +195,18 @@ public class EntityItem extends Entity {
|
|||
this.age = nbttagcompound.getShort("Age");
|
||||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item");
|
||||
|
||||
this.setItemStack(ItemStack.a(nbttagcompound1));
|
||||
// CraftBukkit start
|
||||
if (nbttagcompound1 != null) {
|
||||
ItemStack itemstack = ItemStack.a(nbttagcompound1);
|
||||
if (itemstack != null) {
|
||||
this.setItemStack(itemstack);
|
||||
} else {
|
||||
this.die();
|
||||
}
|
||||
} else {
|
||||
this.die();
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (this.getItemStack() == null) {
|
||||
this.die();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue