Tube worms, floating block fixes

This commit is contained in:
paulevsGitch 2020-12-06 05:21:35 +03:00
parent 08e31b8743
commit e3769bb20b
17 changed files with 413 additions and 9 deletions

View file

@ -20,13 +20,13 @@ public class WallPlantFeature extends WallScatterFeature {
@Override
public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos pos, Direction dir) {
BlockPos blockPos = pos.offset(dir.getOpposite());
BlockState blockState = world.getBlockState(blockPos);
return ((BlockWallPlant) block).isSupport(world, blockPos, blockState, dir);
BlockState state = block.getDefaultState().with(BlockWallPlant.FACING, dir);
return block.canPlaceAt(state, world, pos);
}
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos pos, Direction dir) {
BlocksHelper.setWithoutUpdate(world, pos, block.getDefaultState().with(BlockWallPlant.FACING, dir));
BlockState state = block.getDefaultState().with(BlockWallPlant.FACING, dir);
BlocksHelper.setWithoutUpdate(world, pos, state);
}
}