Fixed sapling bugs
This commit is contained in:
parent
cb274320d7
commit
9281fabd5f
4 changed files with 6 additions and 13 deletions
|
@ -26,7 +26,6 @@ import ru.betterend.client.render.ERenderLayer;
|
|||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public abstract class BlockFeatureSapling extends BlockBaseNotFull implements Fertilizable, IRenderTypeable {
|
||||
private static final VoxelShape SHAPE = Block.createCuboidShape(4, 0, 4, 12, 14, 12);
|
||||
|
@ -82,10 +81,7 @@ public abstract class BlockFeatureSapling extends BlockBaseNotFull implements Fe
|
|||
|
||||
@Override
|
||||
public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos, Blocks.AIR.getDefaultState());
|
||||
if (!getFeature().generate(world, world.getChunkManager().getChunkGenerator(), random, pos, null)) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos, this.getDefaultState());
|
||||
}
|
||||
getFeature().generate(world, world.getChunkManager().getChunkGenerator(), random, pos, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -50,6 +50,7 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
if (!SplineHelper.canGenerate(spline, pos, world, REPLACE)) {
|
||||
return false;
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(world, pos, AIR);
|
||||
|
||||
Vector3f last = SplineHelper.getPos(spline, 3.5F);
|
||||
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
|
||||
|
|
|
@ -48,13 +48,8 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos blockPos, DefaultFeatureConfig featureConfig) {
|
||||
blockPos = getPosOnSurface(world, blockPos);
|
||||
if (blockPos.getY() < 5) {
|
||||
return false;
|
||||
}
|
||||
if (!world.getBlockState(blockPos.down()).isIn(EndTags.END_GROUND)) {
|
||||
return false;
|
||||
}
|
||||
BlockState down = world.getBlockState(blockPos.down());
|
||||
if (!down.isOf(EndBlocks.END_MYCELIUM) && !down.isOf(EndBlocks.END_MOSS)) return false;
|
||||
|
||||
CONE1.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP);
|
||||
CONE2.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP);
|
||||
|
@ -74,7 +69,6 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
if (!SplineHelper.canGenerate(spline, scale, blockPos, world, REPLACE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlocksHelper.setWithoutUpdate(world, blockPos, AIR);
|
||||
|
||||
CENTER.set(blockPos.getX(), 0, blockPos.getZ());
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
|||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.util.MHelper;
|
||||
import ru.betterend.util.SplineHelper;
|
||||
import ru.betterend.util.sdf.PosInfo;
|
||||
|
@ -34,6 +35,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||
if (world.getBlockState(pos.down()).getBlock() != EndBlocks.CHORUS_NYLIUM) return false;
|
||||
BlocksHelper.setWithoutUpdate(world, pos, AIR);
|
||||
|
||||
float size = MHelper.randRange(10, 20, random);
|
||||
List<Vector3f> spline = SplineHelper.makeSpline(0, 0, 0, 0, size, 0, 4);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue