diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index ffd0e83f5..025e84420 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -371,6 +371,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @Override public void openInventory(InventoryView inventory) { + Preconditions.checkArgument(this.equals(inventory.getPlayer()), "InventoryView must belong to the opening player"); if (!(getHandle() instanceof EntityPlayer)) return; // TODO: NPC support? if (((EntityPlayer) getHandle()).connection == null) return; if (getHandle().containerMenu != getHandle().inventoryMenu) {