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
FieldsModifier and TypeFieldDescriptionprotected longThe time after which the event can be executed -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe check to ensure the conditions are correct for the Delayed Event to executebooleanshouldRequeue(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, waitMethods 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:IDelayedEventThe check to ensure the conditions are correct for the Delayed Event to execute- Specified by:
canExecutein interfaceIDelayedEvent- Returns:
- True if the conditions are right to execute this delayed event
-
shouldRequeue
public boolean shouldRequeue(boolean hasFinished) Description copied from interface:IDelayedEventChecks 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:
shouldRequeuein interfaceIDelayedEvent- Parameters:
hasFinished- True if the event has executed- Returns:
- True if the event should be requeued
-