Class Chest
java.lang.Object
marauroa.common.game.Attributes
marauroa.common.game.SlotOwner
marauroa.common.game.RPObject
games.stendhal.server.entity.Entity
games.stendhal.server.entity.mapstuff.chest.Chest
- All Implemented Interfaces:
UseListener,Killer,Cloneable,Iterable<String>,Serializable
- Direct Known Subclasses:
NPCOwnedChest,PersonalChest,StoredChest
A chest is an unmovable container. It can be opened and closed. While it is
open, every player can put items in and take them out later. A player can
take out items that another player put in.
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID -
Field Summary
Fields inherited from class marauroa.common.game.RPObject
INVALID_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(PassiveEntity entity) Adds a passive entity (like an item) to the chest.voidclose()Close the chest.describe()Describes the entity (if a players looks at it).static voidReturns the content.getDescriptionName(boolean definite) Returns the name or something that can be used to identify the entity for the player.booleanisOpen()Determine if the chest is open.booleanInvoked when the object is used.voidopen()Open the chest.intsize()Returns the number of attributes and events this object is made of.voidupdate()Methods inherited from class games.stendhal.server.entity.Entity
getAdjacentNodes, getArea, getArea, getCursor, getDescription, getEntitySlot, getHeight, getName, getOrigin, getResistance, getResistance, getTitle, getWidth, getX, getY, getZone, hasDescription, isInSight, isObstacle, nextTo, nextTo, notifyWorldAboutChanges, onAdded, onMoved, onRemoved, setCursor, setDescription, setEntityClass, setEntitySubclass, setMenu, setPosition, setResistance, setSize, setVisibility, slotIterator, slots, squaredDistance, squaredDistance, stoppedMethods inherited from class marauroa.common.game.RPObject
addEvent, addLink, addLink, addMap, addSlot, addSlot, applyDifferences, clearEvents, clearVisible, clone, containsKey, equals, events, eventsIterator, fill, get, getBaseContainer, getBoolean, getContainer, getContainerBaseOwner, getContainerOwner, getContainerSlot, getDifferences, getDouble, getFromSlots, getID, getInt, getLink, getLinkedObject, getMap, getSlot, has, hashCode, hasLink, hasMap, hasSlot, hide, isContained, isEmpty, isHidden, isStorable, maps, put, put, put, put, readObject, remove, removeLink, removeMap, removeSlot, resetAddedAndDeleted, resetAddedAndDeletedMaps, resetAddedAndDeletedRPLink, resetAddedAndDeletedRPSlot, setAddedMaps, setAddedRPSlot, setContainer, setDeletedMaps, setDeletedRPSlot, setID, slots, slotsIterator, store, toString, unhide, unstore, writeObject, writeObject, writeToJsonMethods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlotsMethods inherited from class marauroa.common.game.Attributes
add, applyDifferences, get, getBool, getDouble, getInt, getList, getLong, getRPClass, has, instanceOf, iterator, put, put, put, put, put, readFromMap, remove, resetAddedAndDeletedAttributes, setAddedAttributes, setDeletedAttributes, setRPClass, setRPClass, toAttributeStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Chest
public Chest()Creates a new chest. -
Chest
Creates a new chest.- Parameters:
object- RPObject
-
-
Method Details
-
generateRPClass
public static void generateRPClass() -
getDescriptionName
Description copied from class:EntityReturns the name or something that can be used to identify the entity for the player.- Overrides:
getDescriptionNamein classEntity- Parameters:
definite- true for "the" and false for "a/an" in case the entity has no name- Returns:
- name
-
update
public void update() -
open
public void open()Open the chest. -
close
public void close()Close the chest. -
isOpen
public boolean isOpen()Determine if the chest is open.- Returns:
trueif the chest is open.
-
add
Adds a passive entity (like an item) to the chest.- Parameters:
entity- entity to add
-
size
public int size()Description copied from class:RPObjectReturns the number of attributes and events this object is made of. -
getContent
Returns the content.- Returns:
- iterator for the content
-
onUsed
Description copied from interface:UseListenerInvoked when the object is used.- Specified by:
onUsedin interfaceUseListener- Parameters:
user- the RPEntity who uses the object- Returns:
- true if successful
-
describe
Description copied from class:EntityDescribes the entity (if a players looks at it).
-