use of net.minecraft.world.level.NoiseColumn in project Brass_Amber_BattleTowers by BrassAmber-Mods.
the class LandBattleTower method isFeatureChunk.
public static boolean isFeatureChunk(PieceGeneratorSupplier.Context<BTJigsawConfiguration> context) {
BlockPos centerOfChunk = context.chunkPos().getMiddleBlockPosition(0);
context.chunkGenerator();
// Grab height of land. Will stop at first non-air block. --TelepathicGrunt
int landHeight = context.chunkGenerator().getFirstOccupiedHeight(centerOfChunk.getX(), centerOfChunk.getZ(), Heightmap.Types.WORLD_SURFACE_WG, context.heightAccessor());
// Grabs column of blocks at given position. In overworld, this column will be made of stone, water, and air.
// In nether, it will be netherrack, lava, and air. End will only be endstone and air. It depends on what block
// the chunk generator will place for that dimension. --TelepathicGrunt
NoiseColumn columnOfBlocks = context.chunkGenerator().getBaseColumn(centerOfChunk.getX(), centerOfChunk.getZ(), context.heightAccessor());
// Combine the column of blocks with land height and you get the top block itself which you can test. --TelepathicGrunt
BlockState topBlock = columnOfBlocks.getBlock(landHeight);
// ;
return isFlatLand(context.chunkGenerator(), centerOfChunk, context.heightAccessor()) && landHeight <= 210;
}
Aggregations