public interface ServerImplementation
| Modifier and Type | Method and Description |
|---|---|
@NotNull AsyncSchedulerImplementation |
async()
Returns the async scheduler.
|
void |
cancelTasks()
Cancels all scheduled tasks that were scheduled using your
Plugin
instance. |
@NotNull EntitySchedulerImplementation |
entity(@NotNull org.bukkit.entity.Entity entity)
Returns an entity scheduler.
|
@NotNull org.bukkit.plugin.Plugin |
getOwningPlugin()
The plugin used to schedule tasks.
|
@NotNull GlobalSchedulerImplementation |
global()
Returns the global region scheduler.
|
boolean |
isOwnedByCurrentRegion(@NotNull org.bukkit.block.Block block)
Returns true if the current thread will be used to tick the region the block is in.
|
boolean |
isOwnedByCurrentRegion(@NotNull org.bukkit.entity.Entity entity)
Returns true if the current thread will be used to tick the region the entity is in.
|
boolean |
isOwnedByCurrentRegion(@NotNull org.bukkit.Location location)
Returns true if the current thread will be used to tick the region the location is in.
|
boolean |
isOwnedByCurrentRegion(@NotNull org.bukkit.Location location,
int squareRadiusChunks)
Returns true if the current thread will be used to tick the region the location, and the surrounding area, is in.
|
boolean |
isOwnedByCurrentRegion(@NotNull org.bukkit.World world,
int chunkX,
int chunkZ)
Returns true if the current thread will be used to tick the region the chunk is in.
|
boolean |
isOwnedByCurrentRegion(@NotNull org.bukkit.World world,
int chunkX,
int chunkZ,
int squareRadiusChunks)
Returns true if the current thread will be used to tick the region the chunk is in, and the surrounding area.
|
default @NotNull RegionSchedulerImplementation |
region(@NotNull org.bukkit.block.Block block)
Returns a region scheduler.
|
default @NotNull RegionSchedulerImplementation |
region(@NotNull org.bukkit.Chunk chunk)
Returns a region scheduler.
|
default @NotNull RegionSchedulerImplementation |
region(@NotNull org.bukkit.Location location)
Returns a region scheduler.
|
@NotNull RegionSchedulerImplementation |
region(@NotNull org.bukkit.World world,
int chunkX,
int chunkZ)
Returns a region scheduler.
|
default @NotNull java.util.concurrent.CompletableFuture<java.lang.Boolean> |
teleportAsync(@NotNull org.bukkit.entity.Entity entity,
@NotNull org.bukkit.Location location)
Teleports an entity to a location.
|
@NotNull java.util.concurrent.CompletableFuture<java.lang.Boolean> |
teleportAsync(@NotNull org.bukkit.entity.Entity entity,
@NotNull org.bukkit.Location location,
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause)
Teleports an entity to a location.
|
@NotNull @NotNull org.bukkit.plugin.Plugin getOwningPlugin()
boolean isOwnedByCurrentRegion(@NotNull
@NotNull org.bukkit.Location location)
location - The location to check.boolean isOwnedByCurrentRegion(@NotNull
@NotNull org.bukkit.Location location,
int squareRadiusChunks)
location - The location to check.squareRadiusChunks - The radius in chunks to check, as a Chebyshev distance.boolean isOwnedByCurrentRegion(@NotNull
@NotNull org.bukkit.block.Block block)
block - The block to check.boolean isOwnedByCurrentRegion(@NotNull
@NotNull org.bukkit.World world,
int chunkX,
int chunkZ)
world - The world the chunk is in.chunkX - The x-coordinate of the chunk.chunkZ - The z-coordinate of the chunk.boolean isOwnedByCurrentRegion(@NotNull
@NotNull org.bukkit.World world,
int chunkX,
int chunkZ,
int squareRadiusChunks)
world - The world the chunk is in.chunkX - The x-coordinate of the chunk.chunkZ - The z-coordinate of the chunk.squareRadiusChunks - The radius in chunks to check, as a Chebyshev distance.boolean isOwnedByCurrentRegion(@NotNull
@NotNull org.bukkit.entity.Entity entity)
entity - The entity to check.@NotNull @NotNull GlobalSchedulerImplementation global()
@NotNull @NotNull AsyncSchedulerImplementation async()
@NotNull @NotNull EntitySchedulerImplementation entity(@NotNull @NotNull org.bukkit.entity.Entity entity)
@NotNull @NotNull RegionSchedulerImplementation region(@NotNull @NotNull org.bukkit.World world, int chunkX, int chunkZ)
@NotNull default @NotNull RegionSchedulerImplementation region(@NotNull @NotNull org.bukkit.Location location)
@NotNull default @NotNull RegionSchedulerImplementation region(@NotNull @NotNull org.bukkit.block.Block block)
@NotNull default @NotNull RegionSchedulerImplementation region(@NotNull @NotNull org.bukkit.Chunk chunk)
void cancelTasks()
Plugin
instance.
Note that Folia implementations will only cancel tasks scheduled using
the GlobalSchedulerImplementation and
AsyncSchedulerImplementation, ignoring any tasks scheduled using
the EntitySchedulerImplementation and
RegionSchedulerImplementation.
@NotNull
default @NotNull java.util.concurrent.CompletableFuture<java.lang.Boolean> teleportAsync(@NotNull
@NotNull org.bukkit.entity.Entity entity,
@NotNull
@NotNull org.bukkit.Location location)
teleportAsync(Entity, Location, PlayerTeleportEvent.TeleportCause).entity - The entity to teleportlocation - The location to teleport the entity to@NotNull
@NotNull java.util.concurrent.CompletableFuture<java.lang.Boolean> teleportAsync(@NotNull
@NotNull org.bukkit.entity.Entity entity,
@NotNull
@NotNull org.bukkit.Location location,
@NotNull
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause)
The returned future will complete when the entity is teleported,
or the teleport fails. If the teleport fails, the future will complete with a value of
false.
Note that this method is only asynchronous on Paper servers, versions 1.13 and later. On
other servers, this method will be delegated to a synchronous task that executes
Entity.teleport(Location) in the main thread (which may lead to lag spikes).
entity - The entity to teleportlocation - The location to teleport the entity tocause - The cause of the teleport