Class DelayedEventsHandler
java.lang.Object
com.datdeveloper.datmoddingapi.delayedEvents.DelayedEventsHandler
A system for delaying the execution of events until a condition is met
DelayedEvents do not execute in a different thread, rather they on the main server tick after their
IDelayedEvent.canExecute()
function tests true.
For executing tasks on another thread, see ConcurrentHandler
.
For an example of a delayed event, see DelayedTeleportEvent
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addEvent
(IDelayedEvent event) Add a DelayedEvent to the Delay Queuestatic void
onTick
(net.neoforged.neoforge.event.tick.ServerTickEvent.Post event) A tick event to execute delayed events
-
Constructor Details
-
DelayedEventsHandler
public DelayedEventsHandler()
-
-
Method Details
-
addEvent
Add a DelayedEvent to the Delay Queue- Parameters:
event
- The event being added to the queue- See Also:
-
onTick
public static void onTick(net.neoforged.neoforge.event.tick.ServerTickEvent.Post event) A tick event to execute delayed events- Parameters:
event
- The server tick event
-