mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 02:17:35 +01:00
Implement API to retrieve and open EnderChests. Adds BUKKIT-2016
This commit is contained in:
parent
feb0327d22
commit
e7e643d83a
@ -36,6 +36,7 @@ import org.bukkit.plugin.Plugin;
|
|||||||
|
|
||||||
public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||||
private CraftInventoryPlayer inventory;
|
private CraftInventoryPlayer inventory;
|
||||||
|
private CraftInventory enderChest;
|
||||||
protected final PermissibleBase perm = new PermissibleBase(this);
|
protected final PermissibleBase perm = new PermissibleBase(this);
|
||||||
private boolean op;
|
private boolean op;
|
||||||
private GameMode mode;
|
private GameMode mode;
|
||||||
@ -44,6 +45,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
super(server, entity);
|
super(server, entity);
|
||||||
mode = server.getDefaultGameMode();
|
mode = server.getDefaultGameMode();
|
||||||
this.inventory = new CraftInventoryPlayer(entity.inventory);
|
this.inventory = new CraftInventoryPlayer(entity.inventory);
|
||||||
|
enderChest = new CraftInventory(entity.getEnderChest());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@ -54,6 +56,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
return inventory;
|
return inventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Inventory getEnderChest() {
|
||||||
|
return enderChest;
|
||||||
|
}
|
||||||
|
|
||||||
public ItemStack getItemInHand() {
|
public ItemStack getItemInHand() {
|
||||||
return getInventory().getItemInHand();
|
return getInventory().getItemInHand();
|
||||||
}
|
}
|
||||||
@ -176,6 +182,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
switch(type) {
|
switch(type) {
|
||||||
case PLAYER:
|
case PLAYER:
|
||||||
case CHEST:
|
case CHEST:
|
||||||
|
case ENDER_CHEST:
|
||||||
getHandle().openContainer(craftinv.getInventory());
|
getHandle().openContainer(craftinv.getInventory());
|
||||||
break;
|
break;
|
||||||
case DISPENSER:
|
case DISPENSER:
|
||||||
|
Loading…
Reference in New Issue
Block a user