Class TeleportScroll

All Implemented Interfaces:
EquipListener, TurnListener, UseListener, Stackable<StackableItem>, Killer, Cloneable, Iterable<String>, Serializable
Direct Known Subclasses:
InvitationScroll, MarkedScroll, TimedTeleportScroll

public abstract class TeleportScroll extends Scroll
Represents a general teleport scroll.
  • Constructor Details

    • TeleportScroll

      public TeleportScroll(String name, String clazz, String subclass, Map<String,​String> attributes)
      Creates a new teleport scroll.
      Parameters:
      name -
      clazz -
      subclass -
      attributes -
    • TeleportScroll

      public TeleportScroll(TeleportScroll item)
      Copy constructor.
      Parameters:
      item - item to copy
  • Method Details

    • useTeleportScroll

      protected abstract boolean useTeleportScroll(Player player)
      Is invoked when a teleporting scroll is actually used.
      Parameters:
      player - The player who used the scroll and who will be teleported
      Returns:
      true iff teleport was successful
    • useScroll

      protected boolean useScroll(Player player)
      Is invoked when a teleporting scroll is used. Tries to put the player on the scroll's destination, or near it.
      Overrides:
      useScroll in class Scroll
      Parameters:
      player - The player who used the scroll and who will be teleported
      Returns:
      true iff teleport was successful