public interface ChunkLoadService
Modifier and Type | Interface and Description |
---|---|
static interface |
ChunkLoadService.Callback |
static interface |
ChunkLoadService.EntityLoadingTicket |
static interface |
ChunkLoadService.LoadingTicket |
static interface |
ChunkLoadService.OrderedCallback |
static interface |
ChunkLoadService.PlayerEntityLoadingTicket |
static interface |
ChunkLoadService.PlayerLoadingTicket |
static interface |
ChunkLoadService.PlayerOrderedCallback |
Modifier and Type | Method and Description |
---|---|
Optional<ChunkLoadService.EntityLoadingTicket> |
createEntityTicket(Object plugin,
World world)
Attempts to create a new loading ticket for a plugin to load chunks in a world.
|
Optional<ChunkLoadService.PlayerEntityLoadingTicket> |
createPlayerEntityTicket(Object plugin,
World world,
UUID player)
Attempts to create a new loading ticket for a plugin to load chunks in a world.
|
Optional<ChunkLoadService.PlayerLoadingTicket> |
createPlayerTicket(Object plugin,
World world,
UUID player)
Attempts to create a new loading ticket for a plugin to load chunks in a world.
|
Optional<ChunkLoadService.LoadingTicket> |
createTicket(Object plugin,
World world)
Attempts to create a new loading ticket for a plugin to load chunks in a world.
|
int |
getAvailableTickets(Object plugin,
World world)
Gets the amount of remaining tickets a plugin can have in the world before
hitting the maximum.
|
int |
getAvailableTickets(UUID player)
Gets the amount of tickets remaining available for a player.
|
ImmutableSetMultimap<com.flowpowered.math.vector.Vector3i,ChunkLoadService.LoadingTicket> |
getForcedChunks(World world)
Gets the set of currently force-loaded chunks in a world.
|
int |
getMaxTickets(Object plugin)
Gets the maximum allowed per-world tickets for a plugin.
|
void |
registerCallback(Object plugin,
ChunkLoadService.Callback callback)
Sets the callback for handling loading forced chunk tickets on world load.
|
void registerCallback(Object plugin, ChunkLoadService.Callback callback)
Required for any plugin that wants to force-load chunks. Any plugin that does not have a registered callback will have all saved tickets dropped on world load.
plugin
- Plugin that is registering a callbackcallback
- The callback function objectOptional<ChunkLoadService.LoadingTicket> createTicket(Object plugin, World world)
Plugins can be limited in the number of tickets they can create per world.
plugin
- Plugin that wants to load chunksworld
- World that chunks will be loaded inOptional<ChunkLoadService.EntityLoadingTicket> createEntityTicket(Object plugin, World world)
This version is to create tickets that are bound to the existence of an Entity. For instance, a ticket to load the chunks a minecart is travelling through.
Plugins can be limited in the number of tickets they can create per world.
plugin
- Plugin that wants to load chunksworld
- World that chunks will be loaded inOptional<ChunkLoadService.PlayerLoadingTicket> createPlayerTicket(Object plugin, World world, UUID player)
.
plugin
- Plugin that wants to load chunksworld
- World that chunks will be loaded inplayer
- Player that chunks are being loaded forOptional<ChunkLoadService.PlayerEntityLoadingTicket> createPlayerEntityTicket(Object plugin, World world, UUID player)
This version is to create tickets that are bound to the existence of an Entity. For instance, a ticket to load the chunks a minecart is travelling through.
Plugins can be limited in the number of tickets they can create per world.
plugin
- Plugin that wants to load chunksworld
- World that chunks will be loaded inplayer
- Player that chunks are being loaded forint getMaxTickets(Object plugin)
plugin
- The plugin to get the maximum ticket count forint getAvailableTickets(Object plugin, World world)
plugin
- The plugin to get the remaining available ticket count forworld
- The world to get the remaining count inint getAvailableTickets(UUID player)
player
- The player to get the number of remaining tickets forImmutableSetMultimap<com.flowpowered.math.vector.Vector3i,ChunkLoadService.LoadingTicket> getForcedChunks(World world)
world
- The world to get force-loaded chunks from