Class PassiveEntityRespawnPoint
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.spawner.PassiveEntityRespawnPoint
- All Implemented Interfaces:
TurnListener
,Killer
,Cloneable
,Iterable<String>
,Serializable
- Direct Known Subclasses:
GrowingPassiveEntityRespawnPoint
,SheepFood
A PassiveEntityRespawnPoint basically is a 1x1 area where a plant, a fruit or
another non-moving thing grows. This growing thing is a pickable Item (e.g. a
mushroom, an apple); by extending this class, it can also grow something
special (e.g. SheepFood).
PassiveEntityRespawnPoint are currently invisible (fully transparent) on the
client side. Extend GrowingPassiveEntityRespawnPoint and implement
UseListener if grown item should not be dragable without special interaction.
- Author:
- Daniel Herding
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
Tells how many turns it takes in average for a new fruit to become ripe.Fields inherited from class marauroa.common.game.RPObject
INVALID_ID
-
Constructor Summary
ConstructorDescriptionPassiveEntityRespawnPoint(String growingItemName, int meanTurnsForRegrow)
PassiveEntityRespawnPoint(RPObject object, String growingItemName, int meanTurnsForRegrow)
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
protected int
protected void
Creates a new fruit.void
onFruitPicked(Item picked)
Is called when a fruit has been picked from this plant grower.void
onItemPickedUp(Player player)
void
onTurnReached(int currentTurn)
This method is called when the turn number is reached.void
void
Methods inherited from class games.stendhal.server.entity.Entity
describe, getAdjacentNodes, getArea, getArea, getCursor, getDescription, getDescriptionName, 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, stopped, update
Methods 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, size, slots, slotsIterator, store, toString, unhide, unstore, writeObject, writeObject, writeToJson
Methods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlots
Methods 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, toAttributeString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
meanTurnsForRegrow
protected int meanTurnsForRegrowTells how many turns it takes in average for a new fruit to become ripe.
-
-
Constructor Details
-
PassiveEntityRespawnPoint
-
PassiveEntityRespawnPoint
-
-
Method Details
-
generateRPClass
public static void generateRPClass() -
onFruitPicked
Is called when a fruit has been picked from this plant grower.- Parameters:
picked
- The fruit that has been picked. Use null for subclasses of PlantGrower that don't use items as fruits.
-
getRandomTurnsForRegrow
protected int getRandomTurnsForRegrow() -
growNewFruit
protected void growNewFruit()Creates a new fruit. -
setToFullGrowth
public void setToFullGrowth() -
onTurnReached
public void onTurnReached(int currentTurn)Description copied from interface:TurnListener
This method is called when the turn number is reached.- Specified by:
onTurnReached
in interfaceTurnListener
- Parameters:
currentTurn
- current turn number
-
setStartState
public void setStartState() -
onItemPickedUp
-