Interface SchedulerSource
- All Known Subinterfaces:
Chunk, Damageable, Entity, LivingEntity, Mob, Player
public interface SchedulerSource
Something bound to a region of the world, on whose thread tasks can be scheduled: an
entity or a chunk.
The target region is resolved when the task is scheduled: a task scheduled for an entity runs on the region that held the entity at that moment.
- Since:
- 0.1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanSchedules a task to run as soon as possible on the region thread owning this source.booleanexecuteDelayed(Runnable task, long delayTicks) Schedules a task to run on the region thread owning this source, after a delay.booleanChecks whether the calling thread may safely touch this source.
-
Method Details
-
execute
Schedules a task to run as soon as possible on the region thread owning this source.- Parameters:
task- the task to run- Returns:
falseif the source is removed and the task was not scheduled- Since:
- 0.1.0
-
executeDelayed
Schedules a task to run on the region thread owning this source, after a delay.- Parameters:
task- the task to rundelayTicks- the minimum number of ticks to wait before running the task- Returns:
falseif the source is removed and the task was not scheduled- Since:
- 0.1.0
-
isOwnedByCurrentThread
boolean isOwnedByCurrentThread()Checks whether the calling thread may safely touch this source.- Returns:
trueif the calling thread is the region thread owning this source- Since:
- 0.1.0
-