Class ModifyWarpEvent

java.lang.Object
com.hypixel.hytale.builtin.teleport.commands.event.ModifyWarpEvent
All Implemented Interfaces:
IBaseEvent<String>, ICancellable, IEvent<String>
Direct Known Subclasses:
RemoveWarpEvent, ReplaceWarpEvent

public abstract class ModifyWarpEvent extends Object implements IEvent<String>, ICancellable
Abstract base class for events that modify an existing warp.

Fired before modification or removal of a warp is applied. Listeners may cancel the event to prevent the modification from taking place.

  • Constructor Details

    • ModifyWarpEvent

      public ModifyWarpEvent(@Nonnull Warp warp)
  • Method Details

    • isCancelled

      public boolean isCancelled()
      Description copied from interface: ICancellable
      Determines whether this event has been cancelled.
      Specified by:
      isCancelled in interface ICancellable
      Returns:
      true if the event has been cancelled, false otherwise.
    • setCancelled

      public void setCancelled(boolean cancelled)
      Description copied from interface: ICancellable
      Called to set whether this event is cancelled.
      Specified by:
      setCancelled in interface ICancellable
      Parameters:
      cancelled - true to cancel the event, false to uncancel it.
    • getWarp

      @Nonnull public Warp getWarp()
      Gets the warp being modified.
      Returns:
      the warp
    • getCancelReason

      @Nullable public Message getCancelReason()
      Gets the reason why the modification was cancelled.
      Returns:
      the cancel reason
    • cancel

      public void cancel(@Nonnull Message reason)
      Cancels the modification with a reason.
      Parameters:
      reason - the reason for cancellation
    • toString

      public String toString()
      Overrides:
      toString in class Object