Interface PlatformRegionHolder

All Known Subinterfaces:
PlatformEntity, PlatformLivingEntity, PlatformLocation, PlatformPlayer

public interface PlatformRegionHolder
Represents an object that holds a region context (e.g., an entity or location) for task scheduling.

This interface is crucial for platforms like Folia where tasks must be scheduled relative to a specific region.

Since:
2.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable ModelTask
    task(@NotNull Runnable runnable)
    Schedules a task to run on the next tick, synchronized with this region holder.
    @Nullable ModelTask
    taskLater(long delay, @NotNull Runnable runnable)
    Schedules a task to run after a delay, synchronized with this region holder.
  • Method Details

    • task

      @Nullable @Nullable ModelTask task(@NotNull @NotNull Runnable runnable)
      Schedules a task to run on the next tick, synchronized with this region holder.
      Parameters:
      runnable - the task to run
      Returns:
      the scheduled task, or null if scheduling failed
      Since:
      2.0.0
    • taskLater

      @Nullable @Nullable ModelTask taskLater(long delay, @NotNull @NotNull Runnable runnable)
      Schedules a task to run after a delay, synchronized with this region holder.
      Parameters:
      delay - the delay in ticks
      runnable - the task to run
      Returns:
      the scheduled task, or null if scheduling failed
      Since:
      2.0.0