|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectItemArray<C>
public abstract class ItemArray<C extends Container<jl>> extends java.lang.Object
ItemArray.java - Interface to jh[] so I don't have to copy+paste this a bunch of times
Modifier and Type | Field and Description |
---|---|
protected C |
container
|
Constructor and Description |
---|
ItemArray(C c)
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(Item item)
Adds the specified item. |
void |
clearContents()
|
Item[] |
getContents()
Returns the contents of this chest |
int |
getContentsSize()
|
int |
getEmptySlot()
Gets the nearest empty slot. |
Item |
getItemFromId(int id)
Retrieves from the slot |
Item |
getItemFromId(int id,
int maxAmount)
Retrieves from the slot |
Item |
getItemFromId(Item.Type type)
Retrieves from the slot |
Item |
getItemFromId(Item.Type type,
int maxAmount)
Retrieves from the slot |
Item |
getItemFromSlot(int slot)
Retrieves from the slot |
boolean |
hasItem(int itemId)
Checks to see if this getArray() has one slot that has the given item id |
boolean |
hasItem(int itemId,
int minimum)
Checks to see if this getArray() has one slot that has the item id and equal or more to the amount. |
boolean |
hasItem(int itemId,
int minimum,
int maximum)
Checks to see if this getArray() has one slot that has the item id and equal or more to the amount. |
boolean |
hasItem(Item.Type type)
Checks to see if this getArray() has one slot that has the given item type |
boolean |
hasItem(Item.Type type,
int minimum)
Checks to see if this getArray() has one slot that has the item id and equal or more to the amount. |
void |
removeItem(int slot)
Removes the item from the slot |
void |
removeItem(int id,
int amount)
Removes the item. |
void |
removeItem(Item.Type type,
int amount)
Removes the item. |
void |
removeItem(Item item)
Removes the item. |
void |
setContents(Item[] contents)
Sets the contents |
void |
setSlot(int itemId,
int amount,
int slot)
Replaces the slot with the specified item. |
void |
setSlot(int itemId,
int amount,
int damage,
int slot)
Replaces the slot with the specified item. |
void |
setSlot(Item.Type type,
int amount,
int slot)
Replaces the slot with the specified item. |
void |
setSlot(Item item,
int slot)
Sets the specified slot with item |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected C extends Container<jl> container
Constructor Detail |
---|
public ItemArray(C c)
Method Detail |
---|
public int getContentsSize()
public void addItem(Item item)
item
- item to addpublic Item getItemFromSlot(int slot)
slot
- slot to get item frompublic Item getItemFromId(Item.Type type)
type
- public Item getItemFromId(int id)
id
- public Item getItemFromId(Item.Type type, int maxAmount)
type
- maxAmount
- public Item getItemFromId(int id, int maxAmount)
id
- maxAmount
- public int getEmptySlot()
public void removeItem(int slot)
slot
- slot to remove item frompublic void setSlot(Item item, int slot)
item
- item to setslot
- slot to usepublic void setSlot(Item.Type type, int amount, int slot)
type
- type of the item to put into the slot.amount
- amount of the item to put into the slot.slot
- the id of the slot.public void setSlot(int itemId, int amount, int slot)
itemId
- item id of the item to put into the slot.amount
- amount of the item to put into the slot.slot
- the id of the slot.public void setSlot(int itemId, int amount, int damage, int slot)
itemId
- item id of the item to put into the slot.amount
- amount of the item to put into the slot.damage
- remaining damage of the item to put into the slot.slot
- the id of the slot.public void removeItem(Item item)
item
- item id and amount to removepublic void removeItem(Item.Type type, int amount)
type
- item to removeamount
- amount to removepublic void removeItem(int id, int amount)
id
- item to removeamount
- amount to removepublic boolean hasItem(Item.Type type)
type
- public boolean hasItem(int itemId)
itemId
- public boolean hasItem(Item.Type type, int minimum)
type
- item to look forminimum
- amount of items that must be in the stackpublic boolean hasItem(int itemId, int minimum)
itemId
- item to look forminimum
- amount of items that must be in the stackpublic boolean hasItem(int itemId, int minimum, int maximum)
itemId
- minimum
- maximum
- public Item[] getContents()
public void setContents(Item[] contents)
contents
- contents to setpublic void clearContents()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |