parent
f9b7fa7da4
commit
412dab0029
@ -27,6 +27,8 @@ import org.bukkit.permissions.PermissionAttachment;
|
||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
||||
public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
private CraftInventoryPlayer inventory;
|
||||
private CraftInventory enderChest;
|
||||
@ -38,6 +40,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
super(server, entity);
|
||||
mode = server.getDefaultGameMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(EntityLivingBase entity) {
|
||||
super.updateEntity(entity);
|
||||
if (inventory != null) inventory.updateInventory(((net.minecraft.entity.player.EntityPlayer) entity).inventory);
|
||||
if (enderChest != null) enderChest.updateInventory(((net.minecraft.entity.player.EntityPlayer) entity).getInventoryEnderChest());
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return getHandle().getCommandSenderName();
|
||||
|
@ -17,11 +17,15 @@ import org.bukkit.Material;
|
||||
|
||||
|
||||
public class CraftInventory implements Inventory {
|
||||
protected final net.minecraft.inventory.IInventory inventory;
|
||||
protected net.minecraft.inventory.IInventory inventory;
|
||||
|
||||
public CraftInventory(net.minecraft.inventory.IInventory inventory) {
|
||||
this.inventory = inventory;
|
||||
}
|
||||
|
||||
public void updateInventory(net.minecraft.inventory.IInventory inventory) {
|
||||
this.inventory = inventory;
|
||||
}
|
||||
|
||||
public net.minecraft.inventory.IInventory getInventory() {
|
||||
return inventory;
|
||||
|
@ -11,7 +11,7 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
|
||||
public CraftInventoryPlayer(net.minecraft.entity.player.InventoryPlayer inventory) {
|
||||
super(inventory);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public net.minecraft.entity.player.InventoryPlayer getInventory() {
|
||||
return (net.minecraft.entity.player.InventoryPlayer) inventory;
|
||||
|
Loading…
Reference in New Issue
Block a user