SPIGOT-1107: Shift clicking and delegation for custom inventories

PR #398

By: Jannyboy11 <jannyboy11@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2017-08-18 18:52:09 +10:00
parent 3c5675eaa3
commit c1ec43fdd8
2 changed files with 45 additions and 239 deletions

View File

@@ -271,7 +271,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
private void openCustomInventory(Inventory inventory, EntityPlayer player, String windowType) {
if (player.playerConnection == null) return;
Container container = new CraftContainer(inventory, this, player.nextContainerCounter());
Container container = new CraftContainer(inventory, this.getHandle(), player.nextContainerCounter());
container = CraftEventFactory.callInventoryOpenEvent(player, container);
if(container == null) return;
@@ -345,7 +345,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
if (inventory instanceof CraftInventoryView) {
container = ((CraftInventoryView) inventory).getHandle();
} else {
container = new CraftContainer(inventory, player.nextContainerCounter());
container = new CraftContainer(inventory, this.getHandle(), player.nextContainerCounter());
}
// Trigger an INVENTORY_OPEN event