Interface BiomeUpdater
- All Superinterfaces:
AbstractBiomeRenderer
Utility class for updating biomes in Minecraft.
This class provides methods for updating the biomes of chunks and regions in a Minecraft world.
It uses the UnsafeValues instance to perform unsafe operations.
- Since:
- 0.0.1
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault List<CompletableFuture<Chunk>> getChunksBetweenLocations(Location from, Location to) Returns a list of chunks between two locations.getPlayersInDistance(Chunk chunk) Gets a list of players who are within the view distance of a given chunk.default booleaninChunkViewDistance(Player player, Chunk chunk) Checks if a player is within the view distance of a chunk.static BiomeUpdaterof()Returns an instance of BiomeUpdater.static BiomeUpdaterReturns an instance of BiomeUpdater with a plugin reference.default voidupdateChunk(CompletableFuture<Chunk> chunk) Deprecated.default voidupdateChunk(Chunk chunk) Updates the biome of a chunk.voidupdateChunkAsync(CompletableFuture<Chunk> chunk) Updates the biome of a chunk.voidupdateChunkRadius(Chunk chunk, int radius) Updates the biomes of all chunks within a certain radius of a given chunk.default voidupdateChunks(Collection<Chunk> chunks) Updates the biomes of a list of chunks within a certain distance.default voidupdateChunks(List<CompletableFuture<Chunk>> chunks) Deprecated, for removal: This API element is subject to removal in a future version.UseupdateChunksAsync(Collection)instead.voidupdateChunks(Location from, Location to) Updates the biomes of the chunks between two locations.voidupdateChunksAsync(Collection<CompletableFuture<Chunk>> chunks) Updates the biomes of a list of chunks within a certain distance.voidupdateChunksForPlayer(Player player) Updates the biomes of all chunks within the player's view distance.
-
Field Details
-
WIRE
-
-
Method Details
-
of
Returns an instance of BiomeUpdater. This method returns an instance of BiomeUpdaterImpl.- Returns:
- an instance of BiomeUpdater.
- Since:
- 0.0.2
-
of
Returns an instance of BiomeUpdater with a plugin reference.- Parameters:
plugin- the plugin to use for scheduling chunk updates. Necessary for Folia compatibility.- Returns:
- an instance of BiomeUpdater with a plugin reference
- Since:
- 1.2.0
-
getChunksBetweenLocations
@AsOf("1.2.0") default List<CompletableFuture<Chunk>> getChunksBetweenLocations(Location from, Location to) Returns a list of chunks between two locations. This method calculates the chunks that are located between the 'from' and 'to' locations. The locations must be in the same world.- Parameters:
from- The starting location.to- The ending location.- Returns:
- A list of chunks between the two locations.
- Since:
- 0.0.1
-
updateChunkAsync
Updates the biome of a chunk. This method is a convenience method that calls the updateChunks method with a list containing the chunk.- Parameters:
chunk- The chunk to update.- Since:
- 2.2.0
-
updateChunk
-
updateChunk
Deprecated.UseupdateChunkAsync(CompletableFuture)instead.Updates the biome of a chunk. This method is a convenience method that calls the updateChunks method with a list containing the chunk.- Parameters:
chunk- The chunk to update.- Since:
- 0.0.1
-
updateChunks
@AsOf("0.0.1") @Contract("null, _ -> fail; _, null -> fail") void updateChunks(Location from, Location to) Updates the biomes of the chunks between two locations. This method is a convenience method that calls the updateChunks method with the chunks between the 'from' and 'to' locations.- Parameters:
from- The starting location.to- The ending location.- Since:
- 0.0.1
-
updateChunksAsync
Updates the biomes of a list of chunks within a certain distance. This method sends an update packet to all players within the specified distance of each chunk in the list. The update packet contains the new biome data for the chunk.- Parameters:
chunks- The chunks to update.- Since:
- 2.2.0
-
updateChunks
Updates the biomes of a list of chunks within a certain distance. This method sends an update packet to all players within the specified distance of each chunk in the list. The update packet contains the new biome data for the chunk.- Parameters:
chunks- The chunks to update.- Since:
- 2.0.0
-
updateChunks
@AsOf("1.2.0") @Deprecated(forRemoval=true, since="2.2.0") @ScheduledForRemoval(inVersion="3.0.0") default void updateChunks(List<CompletableFuture<Chunk>> chunks) Deprecated, for removal: This API element is subject to removal in a future version.UseupdateChunksAsync(Collection)instead.Updates the biomes of a list of chunks within a certain distance. This method sends an update packet to all players within the specified distance of each chunk in the list. The update packet contains the new biome data for the chunk.- Parameters:
chunks- The chunks to update.- Since:
- 0.0.1
-
updateChunkRadius
Updates the biomes of all chunks within a certain radius of a given chunk. This method calculates all chunks within the specified radius and sends an update packet to them.- Parameters:
chunk- The center chunk.radius- The radius around the chunk to update.
-
updateChunksForPlayer
-
inChunkViewDistance
-
getPlayersInDistance
Gets a list of players who are within the view distance of a given chunk.- Parameters:
chunk- The chunk for which to get the players within its view distance.- Returns:
- A list of players who are within the view distance of the chunk.
- Since:
- 2.3.0
-
updateChunkAsync(CompletableFuture)instead.