mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-20 22:42:10 +01:00
#1433: HumanEntity#openInventory(InventoryView) should only support views belonging to the player
By: Miles Holder <mwholder2005@gmail.com>
This commit is contained in:
parent
aef018b9c4
commit
477394d314
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user