Fixes
This commit is contained in:
parent
cac7be60b1
commit
bf2249335e
10 changed files with 57 additions and 186 deletions
|
@ -47,7 +47,6 @@ public class EndFeature {
|
|||
this.featureStep = GenerationStep.Feature.VEGETAL_DECORATION;
|
||||
this.feature = Registry.register(Registry.FEATURE, id, feature);
|
||||
this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.configure(FeatureConfig.DEFAULT).decorate(ConfiguredFeatures.Decorators.SQUARE_HEIGHTMAP).repeatRandomly(density));
|
||||
//return new EndFeature(name, feature, GenerationStep.Feature.VEGETAL_DECORATION, feature.configure(FeatureConfig.DEFAULT).decorate(ConfiguredFeatures.Decorators.SQUARE_HEIGHTMAP).repeatRandomly(4));
|
||||
}
|
||||
|
||||
public static EndFeature makeRawGenFeature(String name, Feature<DefaultFeatureConfig> feature, int chance) {
|
||||
|
|
|
@ -20,7 +20,7 @@ public class EndLotusLeafFeature extends ScatterFeature {
|
|||
|
||||
@Override
|
||||
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
|
||||
if (hasLeaf(world, blockPos)) {
|
||||
if (canGenerate(world, blockPos)) {
|
||||
generateLeaf(world, blockPos);
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class EndLotusLeafFeature extends ScatterFeature {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean hasLeaf(StructureWorldAccess world, BlockPos pos) {
|
||||
private boolean canGenerate(StructureWorldAccess world, BlockPos pos) {
|
||||
Mutable p = new Mutable();
|
||||
p.setY(pos.getY());
|
||||
int count = 0;
|
||||
|
@ -57,7 +57,7 @@ public class EndLotusLeafFeature extends ScatterFeature {
|
|||
p.setX(pos.getX() + x);
|
||||
for (int z = -1; z < 2; z ++) {
|
||||
p.setZ(pos.getZ() + z);
|
||||
if (world.isAir(p))
|
||||
if (world.isAir(p) && world.getBlockState(p.down()).isOf(Blocks.WATER))
|
||||
count ++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue