Cave bushes
This commit is contained in:
parent
8a89794f08
commit
28d501f351
19 changed files with 264 additions and 11 deletions
|
@ -4,6 +4,7 @@ import java.util.Random;
|
|||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos.Mutable;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
|
@ -24,7 +25,9 @@ public abstract class InvertedScatterFeature extends DefaultFeature {
|
|||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos center, DefaultFeatureConfig featureConfig) {
|
||||
for (int y = 128; y > 0; y--) {
|
||||
int maxY = world.getTopY(Heightmap.Type.WORLD_SURFACE_WG, center.getX(), center.getZ());
|
||||
int minY = BlocksHelper.upRay(world, new BlockPos(center.getX(), 0, center.getZ()), maxY);
|
||||
for (int y = maxY; y > minY; y--) {
|
||||
POS.set(center.getX(), y, center.getZ());
|
||||
if (world.getBlockState(POS).isAir() && !world.getBlockState(POS.up()).isAir()) {
|
||||
float r = MHelper.randRange(radius * 0.5F, radius, random);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue