Interface BiomeUpdater

All Superinterfaces:
AbstractBiomeRenderer

@NullMarked @AsOf("1.2.0") public interface BiomeUpdater extends 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
  • Field Details

  • Method Details

    • of

      @AsOf("1.2.0") static BiomeUpdater of()
      Returns an instance of BiomeUpdater. This method returns an instance of BiomeUpdaterImpl.
      Returns:
      an instance of BiomeUpdater.
      Since:
      0.0.2
    • of

      @AsOf("1.2.0") static BiomeUpdater of(Plugin plugin)
      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

      @AsOf("2.0.0") void updateChunkAsync(CompletableFuture<Chunk> chunk)
      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

      @AsOf("2.2.0") default void updateChunk(Chunk chunk)
      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

      @AsOf("1.2.0") @Deprecated(since="2.0.0") default void updateChunk(CompletableFuture<Chunk> chunk)
      Deprecated.
      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

      @AsOf("2.2.0") void updateChunksAsync(Collection<CompletableFuture<Chunk>> chunks)
      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

      @AsOf("2.0.0") default void updateChunks(Collection<Chunk> chunks)
      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.
      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

      @AsOf("0.0.15") void updateChunkRadius(Chunk chunk, int radius)
      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

      @AsOf("0.0.15") void updateChunksForPlayer(Player player)
      Updates the biomes of all chunks within the player's view distance. This method calculates all chunks within the player's view distance and sends an update packet to them.
      Parameters:
      player - the player for whom to update the chunks
    • inChunkViewDistance

      @AsOf("2.3.0") default boolean inChunkViewDistance(Player player, Chunk chunk)
      Checks if a player is within the view distance of a chunk.
      Parameters:
      player - the player
      chunk - the chunk
      Returns:
      true if the player is within the view distance of the chunk, false otherwise
      Since:
      2.3.0
    • getPlayersInDistance

      @AsOf("2.3.0") default List<Player> getPlayersInDistance(Chunk chunk)
      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