Updating Biomes
The BiomeUpdater
is an interface for updating biomes in real-time without the need for players to relog or for chunks to be reloaded.
The biome updater works by re-sending the chunk packets to players with the updated biome data.
-
updateChunk(Chunk) -
updateChunkAsync(CompletableFuture<Chunk>) -
updateChunks(Collection<Chunk>) -
updateChunksAsync(Collection<CompletableFuture<Chunk>>) -
updateChunkRadius(Chunk, int) -
updateChunksForPlayer(Player)
Example Usage
Section titled “Example Usage”import me.outspending.biomesapi.renderer.updater.BiomeUpdater;
import org.bukkit.Chunk;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
public class ExampleListener implements Listener {
private static final BiomeUpdater BIOME_UPDATER = BiomeUpdater.of();
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
Chunk chunk = event.getBlock().getChunk();
// Update the biome of the chunk
BIOME_UPDATER.updateChunk(chunk);
}
}