#1433: HumanEntity#openInventory(InventoryView) should only support views belonging to the player
This commit is contained in:
parent
764a541c5b
commit
ab29122cf1
@ -371,6 +371,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openInventory(InventoryView inventory) {
|
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 (!(getHandle() instanceof EntityPlayer)) return; // TODO: NPC support?
|
||||||
if (((EntityPlayer) getHandle()).connection == null) return;
|
if (((EntityPlayer) getHandle()).connection == null) return;
|
||||||
if (getHandle().containerMenu != getHandle().inventoryMenu) {
|
if (getHandle().containerMenu != getHandle().inventoryMenu) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user