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

public class CoalSource extends PlayerActivityEntity
A coal source is a spot where a player can pick for coal. He needs a pick, time, and luck. Picking coals takes 7-11 seconds; during this time, the player keep standing next to the coal source. In fact, the player only has to be there when the prospecting action has finished. Therefore, make sure that two sources are always at least 5 sec of walking away from each other, so that the player can't prospect at several sites simultaneously.
Author:
hendrik
  • Constructor Details

    • CoalSource

      public CoalSource()
      Create a gold source.
    • CoalSource

      public CoalSource(String itemName)
      Create a coal source.
      Parameters:
      itemName - The name of the item to be prospected.
  • Method Details

    • getName

      public String getName()
      source name.
      Specified by:
      getName in interface Killer
      Overrides:
      getName in class Entity
      Returns:
      name
    • getDuration

      protected int getDuration()
      Get the time it takes to perform this activity.
      Specified by:
      getDuration in class PlayerActivityEntity
      Returns:
      The time to perform the activity (in seconds).
    • isPrepared

      protected boolean isPrepared(Player player)
      Decides if the activity can be done.
      Specified by:
      isPrepared in class PlayerActivityEntity
      Parameters:
      player - for whom to perform the activity
      Returns:
      true if successful.
    • isSuccessful

      protected boolean isSuccessful(Player player)
      Decides if the activity was successful.
      Specified by:
      isSuccessful in class PlayerActivityEntity
      Parameters:
      player - for whom to perform the activity
      Returns:
      true if successful.
    • onFinished

      protected void onFinished(Player player, boolean successful)
      Called when the activity has finished.
      Specified by:
      onFinished in class PlayerActivityEntity
      Parameters:
      player - The player that did the activity.
      successful - If the activity was successful.
    • onStarted

      protected void onStarted(Player player)
      Called when the activity has started.
      Specified by:
      onStarted in class PlayerActivityEntity
      Parameters:
      player - The player starting the activity.