Search in sources :

Example 1 with ChunkBiomeContainer

use of net.minecraft.world.level.chunk.ChunkBiomeContainer in project Denizen-For-Bukkit by DenizenScript.

the class ChunkHelperImpl method setAllBiomes.

@Override
public void setAllBiomes(Chunk chunk, BiomeNMS biome) {
    Biome nmsBiome = ((BiomeNMSImpl) biome).biomeBase;
    LevelChunk nmsChunk = ((CraftChunk) chunk).getHandle();
    ChunkBiomeContainer biomeContainer = nmsChunk.getBiomes();
    for (int x = 0; x < 4; x++) {
        for (int y = 0; y < 64; y++) {
            for (int z = 0; z < 4; z++) {
                biomeContainer.setBiome(x, y, z, nmsBiome);
            }
        }
    }
    nmsChunk.markUnsaved();
}
Also used : Biome(net.minecraft.world.level.biome.Biome) LevelChunk(net.minecraft.world.level.chunk.LevelChunk) CraftChunk(org.bukkit.craftbukkit.v1_17_R1.CraftChunk) ChunkBiomeContainer(net.minecraft.world.level.chunk.ChunkBiomeContainer) BiomeNMSImpl(com.denizenscript.denizen.nms.v1_17.impl.BiomeNMSImpl)

Aggregations

BiomeNMSImpl (com.denizenscript.denizen.nms.v1_17.impl.BiomeNMSImpl)1 Biome (net.minecraft.world.level.biome.Biome)1 ChunkBiomeContainer (net.minecraft.world.level.chunk.ChunkBiomeContainer)1 LevelChunk (net.minecraft.world.level.chunk.LevelChunk)1 CraftChunk (org.bukkit.craftbukkit.v1_17_R1.CraftChunk)1