public class Bag extends Entity
Modifier and Type | Field and Description |
---|---|
static int |
BAG_USE_TYPE_EQUIPPED |
static int |
BAG_USE_TYPE_STANDARD |
static int |
BAG_USE_TYPE_STORAGE |
log, staticLock, subObjectNamespacesInt, transientPropertyKeys, type
lock, name
Constructor and Description |
---|
Bag() |
Bag(int numSlots) |
Bag(int id,
int numSlots) |
Bag(OID oid) |
Modifier and Type | Method and Description |
---|---|
int |
addChestLocks(int amount,
OID chestLock)
Adds a specific amount of locks to the chest and returns
the leftover amount if the limit is reached.
|
boolean |
addItem(OID oid)
add item to next available slot
|
void |
applySettings(int numSlots,
int useType)
Applies the settings for the bag.
|
java.lang.Integer |
findItem(OID itemOid)
returns the slotnumber where the item is located in this bag, or null if not
found
|
boolean |
getBank() |
OID |
getChestLock() |
OID |
getItem(int slotNum) |
OID[] |
getItemsList() |
int |
getItemTemplateID() |
int |
getLockLimit() |
int |
getNumLocks() |
int |
getNumSlots() |
ObjectType |
getType()
Entity object type.
|
int |
getUseType() |
boolean |
isEmpty() |
boolean |
isLockable() |
boolean |
isLocked() |
int |
itemCount() |
boolean |
putItem(int slotNum,
OID itemOid)
places item into specified slot. slotNum starts with 0 returns false if
there already is an item
|
void |
removeChestLocks(int amount) |
boolean |
removeItem(OID oid) |
void |
setBank(boolean b) |
void |
setChestLock(OID chestLock) |
void |
setItemsList(OID[] items)
java beans paradigm for saving into the databse
|
void |
setItemTemplateID(int id) |
void |
setLockable(boolean lockable) |
void |
setLocked() |
void |
setLockLimit(int lockLimit) |
void |
setNumLocks(int numLocks) |
void |
setNumSlots(int numSlots) |
void |
setUseType(int useType) |
addSubObjectNamespace, equals, equals, getLock, getNamespace, getOid, getPersistenceFlag, getProperty, getSubObjectNamespaces, getSubObjectNamespacesInt, getTransientDataRef, hashCode, hasSubObjectNamespace, isDeleted, registerTransientPropertyKey, removeProperty, removeSubObjectNamespace, setDeleted, setNamespace, setOid, setPersistenceFlag, setProperty, setSubObjectNamespaces, setSubObjectNamespacesInt, setType, toBytes, toString, unregisterTransientPropertyKey
getBooleanProperty, getIntProperty, getName, getPropertyMap, getPropertyMapRef, getStringProperty, lock, modifyIntProperty, setName, setPropertyMap, setupTransient, unlock
public static final int BAG_USE_TYPE_STANDARD
public static final int BAG_USE_TYPE_EQUIPPED
public static final int BAG_USE_TYPE_STORAGE
public Bag()
public Bag(OID oid)
public Bag(int numSlots)
public Bag(int id, int numSlots)
public void applySettings(int numSlots, int useType)
numSlots
- useType
- public ObjectType getType()
Entity
getType
in class Entity
ObjectTypes.unknown
if no object type has been set.public int getNumSlots()
public void setNumSlots(int numSlots)
public int getItemTemplateID()
public void setItemTemplateID(int id)
public int getUseType()
public void setUseType(int useType)
public boolean putItem(int slotNum, OID itemOid)
public OID getItem(int slotNum)
public boolean addItem(OID oid)
public boolean removeItem(OID oid)
public void setItemsList(OID[] items)
public OID[] getItemsList()
public boolean isEmpty()
public int itemCount()
public java.lang.Integer findItem(OID itemOid)
itemOid
- oid for the item you are looking forpublic int getNumLocks()
public void setNumLocks(int numLocks)
public OID getChestLock()
public void setChestLock(OID chestLock)
public int addChestLocks(int amount, OID chestLock)
amount
- chestLock
- public void removeChestLocks(int amount)
public boolean isLocked()
public boolean isLockable()
public void setLockable(boolean lockable)
public int getLockLimit()
public void setLockLimit(int lockLimit)
public void setLocked()
public void setBank(boolean b)
public boolean getBank()