001 /** 002 * Inventory.java - Interface to player inventories 003 * 004 * @author James 005 */ 006 public interface Inventory { 007 /** 008 * Updates this inventory, sending the new information to clients 009 */ 010 public void update(); 011 012 /** 013 * Clears this inventory 014 */ 015 public void clearContents(); 016 017 public void addItem(Item item); 018 public Item getItemFromSlot(int slot); 019 public Item getItemFromId(Item.Type type); 020 public Item getItemFromId(int id); 021 public Item getItemFromId(Item.Type type, int maxAmount); 022 public Item getItemFromId(int id, int maxAmount); 023 public int getEmptySlot(); 024 public void removeItem(int slot); 025 public void setSlot(Item item, int slot); 026 public void setSlot(Item.Type type, int amount, int slot); 027 public void setSlot(int itemId, int amount, int slot); 028 public void setSlot(int itemId, int amount, int damage, int slot); 029 public void removeItem(Item item); 030 public void removeItem(Item.Type type, int amount); 031 public void removeItem(int id, int amount); 032 public boolean hasItem(Item.Type type); 033 public boolean hasItem(int itemId); 034 public boolean hasItem(Item.Type type, int minimum); 035 public boolean hasItem(int itemId, int minimum); 036 public boolean hasItem(int itemId, int minimum, int maximum); 037 public Item[] getContents(); 038 public void setContents(Item[] contents); 039 public int getContentsSize(); 040 public String getName(); 041 public void setName(String value); 042 }