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