diff --git a/src/net/minecraft/entity/EntityItem.java b/src/net/minecraft/entity/EntityItem.java index 741153d..a2edc3a 100644 --- a/src/net/minecraft/entity/EntityItem.java +++ b/src/net/minecraft/entity/EntityItem.java @@ -23,6 +23,15 @@ public class EntityItem extends Entity { this.yOffset = this.height / 2.0F; this.setPosition(var2, var4, var6); this.item = var8; + // Patch start + if (this.item.itemID < 0 || this.item.itemID >= Item.itemsList.length || Item.itemsList[this.item.itemID] == null) { + this.setEntityDead(); + this.item = new ItemStack(Block.stone); // Workaround for the EntityTracker + } + if (this.item.stackSize < 1) { + this.item.stackSize = 1; + } + // Patch end this.rotationYaw = (float) (Math.random() * 360.0D); this.motionX = (double) ((float) (Math.random() * (double) 0.2F - (double) 0.1F)); this.motionY = (double) 0.2F; @@ -47,6 +56,12 @@ public class EntityItem extends Entity { if (this.delayBeforeCanPickup > 0) { --this.delayBeforeCanPickup; } + // Patch start + if (this.item.itemID < 0 || this.item.itemID >= Item.itemsList.length || Item.itemsList[this.item.itemID] == null) { + this.setEntityDead(); + this.age = 6001; + } + // Patch end this.prevPosX = this.posX; this.prevPosY = this.posY;