Updated inventories to a has-a relationship.

Added PlayerInventory interface with playeronly methods.
Add equals to ItemStack.
This commit is contained in:
Erik Broes
2011-01-09 18:21:31 +01:00
parent b1cab8c5ee
commit 9498644672
6 changed files with 237 additions and 50 deletions

View File

@@ -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();
}
}