Interface ModThread
- All Superinterfaces:
Executor
The mod's own platform thread,
zf-mod-<id>: runs one task at a time, in the order
they were submitted. ZomboidForge shuts it down when the server stops; tasks submitted after
that are rejected with a RejectedExecutionException. It must not
touch game objects; that goes through main().-
Method Summary
Modifier and TypeMethodDescriptionvoidRunstaskon the mod thread.booleanWhether the calling thread is this mod thread.Runstaskonce afterdelay.scheduleAtFixedRate(Runnable task, Duration initialDelay, Duration period) RunstaskafterinitialDelay, then everyperiod, measured from the start of each run.scheduleWithFixedDelay(Runnable task, Duration initialDelay, Duration delay) RunstaskafterinitialDelay, then againdelayafter each run finished.<T> CompletableFuture<T> Runstaskon the mod thread; the future completes with its result or exception.
-
Method Details
-
execute
-
submit
Runstaskon the mod thread; the future completes with its result or exception. -
schedule
Runstaskonce afterdelay. An exception it throws is logged. -
scheduleAtFixedRate
RunstaskafterinitialDelay, then everyperiod, measured from the start of each run. A run that throws is logged and ends the schedule. -
scheduleWithFixedDelay
RunstaskafterinitialDelay, then againdelayafter each run finished. A run that throws is logged and ends the schedule. -
isModThread
boolean isModThread()Whether the calling thread is this mod thread.
-