Added getContents() to IInventory and implemented it.
Implemented Inventory and PlayerInventory and updated StorageMinecart and Slot. Added getMaxStackSize to CraftItemStack.
This commit is contained in:
@@ -2,22 +2,18 @@
|
||||
package org.bukkit.craftbukkit;
|
||||
|
||||
import net.minecraft.server.EntityPlayer;
|
||||
import net.minecraft.server.InventoryPlayer;
|
||||
import org.bukkit.HumanEntity;
|
||||
import org.bukkit.ItemStack;
|
||||
import org.bukkit.PlayerInventory;
|
||||
|
||||
public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
private EntityPlayer entity;
|
||||
private CraftInventoryPlayer inventory;
|
||||
|
||||
public CraftHumanEntity(final CraftServer server, final EntityPlayer entity) {
|
||||
super(server, entity);
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
public ItemStack getSelectedItem() {
|
||||
// TODO: Implement inventories
|
||||
final InventoryPlayer inventory = entity.an;
|
||||
return new ItemStack(inventory.e().c, inventory.e().a);
|
||||
this.inventory = new CraftInventoryPlayer( entity.an );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
@@ -34,6 +30,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
public PlayerInventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
public ItemStack getItemInHand() {
|
||||
return getInventory().getItemInHand();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftHumanEntity{" + "id=" + getEntityID() + "name=" + getName() + '}';
|
||||
|
||||
Reference in New Issue
Block a user