public interface ChunkTicketManager
Modifier and Type | Interface and Description |
---|---|
static interface |
ChunkTicketManager.Callback
A callback for loading tickets during world load.
|
static interface |
ChunkTicketManager.EntityLoadingTicket
Represents a loading ticket which is attached to a specific entity.
|
static interface |
ChunkTicketManager.LoadingTicket
Represents a handle which allows you to force a set of chunks to remain
loaded.
|
static interface |
ChunkTicketManager.OrderedCallback
A ordered callback for loading tickets during world load.
|
static interface |
ChunkTicketManager.PlayerEntityLoadingTicket
Represents a loading ticket which is attached to a player entity.
|
static interface |
ChunkTicketManager.PlayerLoadingTicket
Represents a loading ticket which is attached to a specific player.
|
static interface |
ChunkTicketManager.PlayerOrderedCallback
A player ordered callback for loading tickets during world load.
|
Modifier and Type | Method and Description |
---|---|
Optional<ChunkTicketManager.EntityLoadingTicket> |
createEntityTicket(Object plugin,
World world)
Attempts to create a new loading ticket for a plugin to load chunks in a
world.
|
Optional<ChunkTicketManager.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<ChunkTicketManager.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<ChunkTicketManager.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,ChunkTicketManager.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,
ChunkTicketManager.Callback callback)
Sets the callback for handling loading forced chunk tickets on world
load.
|
void registerCallback(Object plugin, ChunkTicketManager.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<ChunkTicketManager.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<ChunkTicketManager.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<ChunkTicketManager.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<ChunkTicketManager.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,ChunkTicketManager.LoadingTicket> getForcedChunks(World world)
world
- The world to get force-loaded chunks from