Updated inventories to a has-a relationship.
Added PlayerInventory interface with playeronly methods. Add equals to ItemStack.
This commit is contained in:
@@ -115,4 +115,23 @@ public class ItemStack {
|
||||
public byte getDamage() {
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximum stacksize for the material hold in this ItemStack
|
||||
* Returns -1 if it has no idea.
|
||||
*
|
||||
* @return The maximum you can stack this material to.
|
||||
*/
|
||||
public int getMaxStackSize() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(ItemStack item) {
|
||||
return item.getAmount() == getAmount() && item.getTypeID() == getTypeID();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user