Interface ChunkManager
- 
 @DoNotStore public interface ChunkManager Manageschunksfor aServerWorld.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> Collection<Ticket<T>>findTickets(DefaultedRegistryReference<TicketType<T>> type)Gets all currently activeticketsthat are of the providedTicketType.<T> Collection<Ticket<T>>findTickets(TicketType<T> type)Gets all currently activeticketsthat are of the providedTicketType.default CompletableFuture<Boolean>regenerateChunk(int cx, int cy, int cz)Regenerates a chunk at the given chunk coordinates.CompletableFuture<Boolean>regenerateChunk(int cx, int cy, int cz, ChunkRegenerateFlag flag)Regenerates a chunk at the given chunk coordinates.default CompletableFuture<Boolean>regenerateChunk(Vector3i chunkPosition)Regenerates a chunk at the given chunk coordinate position.default CompletableFuture<Boolean>regenerateChunk(Vector3i chunkPosition, ChunkRegenerateFlag flag)Regenerates a chunk at the given chunk coordinate position.booleanreleaseTicket(Ticket<?> ticket)Releases the providedTicket, allowing the chunk position represented by the given ticket to be unloaded (if it is not being kept loaded by other means).booleanrenewTicket(Ticket<?> ticket)Attempts to renew this ticket, resetting the lifetime to the default.default Optional<Ticket<Vector3i>>requestTicket(DefaultedRegistryReference<TicketType<Vector3i>> type, Vector3i chunkOrigin, int radius)Request aTicketfor a givenTicketTypethat supports a chunk position.default <T> Optional<Ticket<T>>requestTicket(DefaultedRegistryReference<TicketType<T>> type, Vector3i chunkOrigin, T value, int radius)Request aTicketfor the givenTicketType.default Optional<Ticket<Vector3i>>requestTicket(TicketType<Vector3i> type, Vector3i chunkOrigin, int radius)Request aTicketfor a givenTicketTypethat supports a chunk position.<T> Optional<Ticket<T>>requestTicket(TicketType<T> type, Vector3i chunkOrigin, T value, int radius)Request aTicketfor the givenTicketType.TickstimeLeft(Ticket<?> ticket)Gets theTicksremaining on the supplied ticket.booleanvalid(Ticket<?> ticket)Checks if the providedTicketis valid for the world this manager represents.ServerWorldworld()Gets theServerWorldthis manager operates upon.
 
- 
- 
- 
Method Detail- 
worldServerWorld world() Gets theServerWorldthis manager operates upon.- Returns:
- The ServerWorld
 
 - 
validboolean valid(Ticket<?> ticket) Checks if the providedTicketis valid for the world this manager represents.- Parameters:
- ticket- The ticket to check.
- Returns:
- true if so
 
 - 
timeLeftTicks timeLeft(Ticket<?> ticket) Gets theTicksremaining on the supplied ticket.- Returns:
- The Ticks
 
 - 
requestTicketdefault Optional<Ticket<Vector3i>> requestTicket(DefaultedRegistryReference<TicketType<Vector3i>> type, Vector3i chunkOrigin, int radius) Request aTicketfor a givenTicketTypethat supports a chunk position.- Parameters:
- type- The type of ticket to request.
- chunkOrigin- The chunk co-ordinates of the central- WorldChunkaffected by this- Ticket
- radius- The radius of the area, in chunks, that this- Ticketaffects.
- Returns:
- The ticket, if granted.
 
 - 
requestTicketdefault Optional<Ticket<Vector3i>> requestTicket(TicketType<Vector3i> type, Vector3i chunkOrigin, int radius) Request aTicketfor a givenTicketTypethat supports a chunk position.- Parameters:
- type- The type of ticket to request.
- chunkOrigin- The chunk co-ordinates of the central- WorldChunkaffected by this- Ticket
- radius- The radius of the area, in chunks, that this- Ticketaffects.
- Returns:
- The ticket, if granted.
 
 - 
requestTicket<T> Optional<Ticket<T>> requestTicket(TicketType<T> type, Vector3i chunkOrigin, T value, int radius) Request aTicketfor the givenTicketType.- Type Parameters:
- T- The type of the supplied- value.
- Parameters:
- type- The type of ticket to request.
- chunkOrigin- The chunk co-ordinates of the central- WorldChunkaffected by this- Ticket
- value- The value to register the ticket with.
- radius- The radius of the area, in chunks, that this- Ticketaffects.
- Returns:
- The ticket, if granted.
 
 - 
requestTicketdefault <T> Optional<Ticket<T>> requestTicket(DefaultedRegistryReference<TicketType<T>> type, Vector3i chunkOrigin, T value, int radius) Request aTicketfor the givenTicketType.- Type Parameters:
- T- The type of the supplied- value.
- Parameters:
- type- The type of ticket to request.
- chunkOrigin- The chunk co-ordinates of the central- WorldChunkaffected by this- Ticket
- value- The value to register the ticket with.
- radius- The radius of the area, in chunks, that this- Ticketaffects. This may be capped - for the Vanilla impl, this is limited to a radius of 33 chunks.
- Returns:
- The ticket, if granted.
 
 - 
renewTicketboolean renewTicket(Ticket<?> ticket) Attempts to renew this ticket, resetting the lifetime to the default.If this ticket is no longer valid, it cannot be renewed. Instead, you should requestTicket(TicketType, Vector3i, Object, int)a new one.- Parameters:
- ticket- The ticket to attempt to renew
- Returns:
- trueif successful
 
 - 
releaseTicketboolean releaseTicket(Ticket<?> ticket) Releases the providedTicket, allowing the chunk position represented by the given ticket to be unloaded (if it is not being kept loaded by other means).- Parameters:
- ticket- The ticket to release.
 
 - 
findTickets<T> Collection<Ticket<T>> findTickets(TicketType<T> type) Gets all currently activeticketsthat are of the providedTicketType.- Type Parameters:
- T- The type of value the- Ticketholds
- Parameters:
- type- The- TicketTypeto retrieve tickets for
- Returns:
- A Collectionoftickets
 
 - 
findTicketsdefault <T> Collection<Ticket<T>> findTickets(DefaultedRegistryReference<TicketType<T>> type) Gets all currently activeticketsthat are of the providedTicketType.- Type Parameters:
- T- The type of value the- Ticketholds
- Parameters:
- type- The- TicketTypeto retrieve tickets for
- Returns:
- A Collectionoftickets
 
 - 
regenerateChunkdefault CompletableFuture<Boolean> regenerateChunk(Vector3i chunkPosition) Regenerates a chunk at the given chunk coordinate position.Care should be taken to check the result of the future, as an exception may be provided if the regeneration was not successful. Users must not use getorjoinon this future. Doing so may end up causing a deadlock on the server.- Parameters:
- chunkPosition- The chunk position to regenerate
- Returns:
- The regenerated chunk, if available
 
 - 
regenerateChunkdefault CompletableFuture<Boolean> regenerateChunk(int cx, int cy, int cz) Regenerates a chunk at the given chunk coordinates.Care should be taken to check the result of the future, as an exception may be provided if the regeneration was not successful. Users must not use getorjoinon this future. Doing so may end up causing a deadlock on the server.- Parameters:
- cx- The chunk x coordinate
- cy- The chunk y coordinate
- cz- The chunk z coordinate
- Returns:
- The regenerated chunk, if available
 
 - 
regenerateChunkdefault CompletableFuture<Boolean> regenerateChunk(Vector3i chunkPosition, ChunkRegenerateFlag flag) Regenerates a chunk at the given chunk coordinate position.Care should be taken to check the result of the future, as an exception may be provided if the regeneration was not successful. Users must not use getorjoinon this future. Doing so may end up causing a deadlock on the server.- Parameters:
- chunkPosition- The chunk position to regenerate
- flag- The chunk regenerate flag to use
- Returns:
- The regenerated chunk, if available
 
 - 
regenerateChunkCompletableFuture<Boolean> regenerateChunk(int cx, int cy, int cz, ChunkRegenerateFlag flag) Regenerates a chunk at the given chunk coordinates.Care should be taken to check the result of the future, as an exception may be provided if the regeneration was not successful. Users must not use getorjoinon this future. Doing so may end up causing a deadlock on the server.- Parameters:
- cx- The chunk x coordinate
- cy- The chunk y coordinate
- cz- The chunk z coordinate
- flag- The chunk regenerate flag to use
- Returns:
- The regenerated chunk, if available
 
 
- 
 
-