All Implemented Interfaces:
TurnListener, UseListener, Killer, Cloneable, Iterable<String>, Serializable

public class GrainField extends GrowingPassiveEntityRespawnPoint implements UseListener
A grain field can be harvested by players who have a scythe. After that, it will slowly regrow; there are several regrowing steps in which the graphics will change to show the progress.
Author:
daniel
  • Field Details

    • RIPE

      public static final int RIPE
      How many growing steps are needed before one can harvest again.
      See Also:
      Constant Field Values
  • Constructor Details

    • GrainField

      public GrainField(String name, List<String> tools)
      creates a new GrainField
      Parameters:
      name - name of the field
      tools - list of tool that can be used to harvest. The first one will be used in the message to the player if he is missing a suitable tool.
  • Method Details

    • getGrainName

      protected String getGrainName()
    • setRipeness

      protected void setRipeness(int ripeness)
      Sets the ripeness
      Overrides:
      setRipeness in class GrowingPassiveEntityRespawnPoint
    • describe

      public String describe()
      Description copied from class: Entity
      Describes the entity (if a players looks at it).
      Overrides:
      describe in class Entity
      Returns:
      description from the players point of view
    • onUsed

      public boolean onUsed(RPEntity entity)
      Is called when a player tries to harvest this grain field.
      Specified by:
      onUsed in interface UseListener
      Parameters:
      entity - the harvesting entity
      Returns:
      true if successful