Refactored setBiome for 1.19
This commit is contained in:
parent
1e56418d26
commit
0c7f2a5b4d
1 changed files with 6 additions and 3 deletions
|
@ -22,6 +22,7 @@ import net.minecraft.world.level.biome.Biomes;
|
||||||
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||||
|
import net.minecraft.world.level.chunk.PalettedContainer;
|
||||||
import net.minecraft.world.level.chunk.PalettedContainerRO;
|
import net.minecraft.world.level.chunk.PalettedContainerRO;
|
||||||
import net.minecraft.world.level.dimension.LevelStem;
|
import net.minecraft.world.level.dimension.LevelStem;
|
||||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||||
|
@ -727,9 +728,11 @@ public class BiomeAPI {
|
||||||
public static void setBiome(ChunkAccess chunk, BlockPos pos, Holder<Biome> biome) {
|
public static void setBiome(ChunkAccess chunk, BlockPos pos, Holder<Biome> biome) {
|
||||||
int sectionY = (pos.getY() - chunk.getMinBuildHeight()) >> 4;
|
int sectionY = (pos.getY() - chunk.getMinBuildHeight()) >> 4;
|
||||||
PalettedContainerRO<Holder<Biome>> biomes = chunk.getSection(sectionY).getBiomes();
|
PalettedContainerRO<Holder<Biome>> biomes = chunk.getSection(sectionY).getBiomes();
|
||||||
//TODO: 1.19 This will disable cave generation the end, Structure was made RO, so we have to find another way to handle this
|
if (biomes instanceof PalettedContainer<Holder<Biome>> palette) {
|
||||||
//biomes.set((pos.getX() & 15) >> 2, (pos.getY() & 15) >> 2, (pos.getZ() & 15) >> 2, biome);
|
palette.set((pos.getX() & 15) >> 2, (pos.getY() & 15) >> 2, (pos.getZ() & 15) >> 2, biome);
|
||||||
BCLib.LOGGER.warning("Unable to change Biome at " + pos);
|
} else {
|
||||||
|
BCLib.LOGGER.warning("Unable to change Biome at " + pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue