Class TimeDelayedEvent

java.lang.Object
com.datdeveloper.datmoddingapi.delayedEvents.TimeDelayedEvent
All Implemented Interfaces:
IDelayedEvent
Direct Known Subclasses:
DelayedTeleportEvent

public abstract class TimeDelayedEvent extends Object implements IDelayedEvent
An abstract implementation of IDelayedEvent that waits until the given delay has passed before executing
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected long
    The time after which the event can be executed
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    TimeDelayedEvent(int Delay)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    The check to ensure the conditions are correct for the Delayed Event to execute
    boolean
    shouldRequeue(boolean hasFinished)
    Checks to see if the code should be requeued to continue waiting to be executed Can be used to restart the delay for the event

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.datdeveloper.datmoddingapi.delayedEvents.IDelayedEvent

    execute
  • Field Details

    • exeTime

      protected long exeTime
      The time after which the event can be executed
  • Constructor Details

    • TimeDelayedEvent

      protected TimeDelayedEvent(int Delay)
  • Method Details

    • canExecute

      public boolean canExecute()
      Description copied from interface: IDelayedEvent
      The check to ensure the conditions are correct for the Delayed Event to execute
      Specified by:
      canExecute in interface IDelayedEvent
      Returns:
      True if the conditions are right to execute this delayed event
    • shouldRequeue

      public boolean shouldRequeue(boolean hasFinished)
      Description copied from interface: IDelayedEvent
      Checks to see if the code should be requeued to continue waiting to be executed Can be used to restart the delay for the event
      Specified by:
      shouldRequeue in interface IDelayedEvent
      Parameters:
      hasFinished - True if the event has executed
      Returns:
      True if the event should be requeued