Cave Flora
This commit is contained in:
parent
d0a16bf66b
commit
8a89794f08
33 changed files with 272 additions and 26 deletions
|
@ -0,0 +1,27 @@
|
|||
package ru.betterend.world.features;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class CavePlantFeature extends FullHeightScatterFeature {
|
||||
private final Block plant;
|
||||
|
||||
public CavePlantFeature(Block plant, int radius) {
|
||||
super(radius);
|
||||
this.plant = plant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos center, BlockPos blockPos, float radius) {
|
||||
return plant.canPlaceAt(world.getBlockState(blockPos), world, blockPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
|
||||
BlocksHelper.setWithoutUpdate(world, blockPos, plant);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue