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;
|
||||
@ -39,6 +41,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
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,12 +17,16 @@ 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user