Package me.deecaad.core.tick
Interface Tickable
- All Known Subinterfaces:
Emitter
- All Known Implementing Classes:
AbstractEmitter,DisplayEntityEmitter,ParticleEmitter,TransformTree
public interface Tickable
Something that wants to be driven once per tick by a
TickManager. Implementations should
return true from tick() when they are finished, so the manager can remove and
clean them up.
On Folia, the manager schedules per-region tasks based on getTickLocation(), so it must
return a non-null location. On non-Folia servers the location is ignored.
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable org.bukkit.LocationThe location used byTickManagerimplementations to choose a region for scheduling.default voidremove()Cleanup hook.booleantick()Performs one tick of work.
-
Method Details
-
tick
boolean tick()Performs one tick of work. Returntruewhen finished; the manager will cancel and callremove().- Returns:
- true to stop ticking.
-
getTickLocation
@Nullable default @Nullable org.bukkit.Location getTickLocation()The location used byTickManagerimplementations to choose a region for scheduling. Must return non-null on Folia.- Returns:
- The location, or
nullif region-agnostic (non-Folia only).
-
remove
default void remove()Cleanup hook. Called by theTickManagerwhentick()returnstrue, or duringTickManager.shutdown(). Default is a no-op.
-