Interface PaperBackend


@Internal public interface PaperBackend
The single-delivery seam between the lifecycle engine and Paper's schedulers.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.papermc.paper.threadedregions.scheduler.ScheduledTask
    async(Consumer<io.papermc.paper.threadedregions.scheduler.ScheduledTask> task, long delayNanos)
    Schedules once on the async pool, using nanoseconds rather than server ticks.
    @Nullable io.papermc.paper.threadedregions.scheduler.ScheduledTask
    entity(org.bukkit.entity.Entity entity, Consumer<io.papermc.paper.threadedregions.scheduler.ScheduledTask> task, Runnable retired, long delayTicks)
    Schedules once on an entity, or returns null if that entity has already retired.
    io.papermc.paper.threadedregions.scheduler.ScheduledTask
    global(Consumer<io.papermc.paper.threadedregions.scheduler.ScheduledTask> task, long delayTicks)
    Schedules once on the global region after at least one tick.
    boolean
    Whether this thread owns global tick work.
    boolean
    isOwnedByCurrentRegion(org.bukkit.entity.Entity entity)
    Whether this thread owns the entity.
    boolean
    isOwnedByCurrentRegion(org.bukkit.World world, int chunkX, int chunkZ)
    Whether this thread owns the chunk.
    live(org.bukkit.plugin.Plugin plugin)
    Creates a backend delegating to the live Paper APIs for the host plugin.
    io.papermc.paper.threadedregions.scheduler.ScheduledTask
    region(org.bukkit.World world, int chunkX, int chunkZ, Consumer<io.papermc.paper.threadedregions.scheduler.ScheduledTask> task, long delayTicks)
    Schedules once on the region owning the chunk after at least one tick.
  • Method Details

    • global

      io.papermc.paper.threadedregions.scheduler.ScheduledTask global(Consumer<io.papermc.paper.threadedregions.scheduler.ScheduledTask> task, long delayTicks)
      Schedules once on the global region after at least one tick.
    • region

      io.papermc.paper.threadedregions.scheduler.ScheduledTask region(org.bukkit.World world, int chunkX, int chunkZ, Consumer<io.papermc.paper.threadedregions.scheduler.ScheduledTask> task, long delayTicks)
      Schedules once on the region owning the chunk after at least one tick.
    • entity

      @Nullable @Nullable io.papermc.paper.threadedregions.scheduler.ScheduledTask entity(org.bukkit.entity.Entity entity, Consumer<io.papermc.paper.threadedregions.scheduler.ScheduledTask> task, Runnable retired, long delayTicks)
      Schedules once on an entity, or returns null if that entity has already retired.
    • async

      io.papermc.paper.threadedregions.scheduler.ScheduledTask async(Consumer<io.papermc.paper.threadedregions.scheduler.ScheduledTask> task, long delayNanos)
      Schedules once on the async pool, using nanoseconds rather than server ticks.
    • isGlobalTickThread

      boolean isGlobalTickThread()
      Whether this thread owns global tick work.
    • isOwnedByCurrentRegion

      boolean isOwnedByCurrentRegion(org.bukkit.World world, int chunkX, int chunkZ)
      Whether this thread owns the chunk.
    • isOwnedByCurrentRegion

      boolean isOwnedByCurrentRegion(org.bukkit.entity.Entity entity)
      Whether this thread owns the entity.
    • live

      static PaperBackend live(org.bukkit.plugin.Plugin plugin)
      Creates a backend delegating to the live Paper APIs for the host plugin.