Class TimeDelayedEvent
java.lang.Object
com.datdeveloper.datmoddingapi.delayedEvents.TimeDelayedEvent
- All Implemented Interfaces:
IDelayedEvent
- Direct Known Subclasses:
DelayedTeleportEvent
An abstract implementation of
IDelayedEvent
that waits until the given delay has passed before executing-
Field Summary
Modifier and TypeFieldDescriptionprotected long
The time after which the event can be executed -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
The check to ensure the conditions are correct for the Delayed Event to executeboolean
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 eventMethods 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 exeTimeThe time after which the event can be executed
-
-
Constructor Details
-
TimeDelayedEvent
protected TimeDelayedEvent(int delay) - Parameters:
delay
- The amount of time in seconds before the delayed event will execute
-
-
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 interfaceIDelayedEvent
- 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 interfaceIDelayedEvent
- Parameters:
hasFinished
- True if the event has executed- Returns:
- True if the event should be requeued
-