Fixed bonemealing for bush block.
This commit is contained in:
@ -5,6 +5,7 @@ import dev.micle.firefly_bush_backport.particle.ModParticles;
|
||||
import dev.micle.firefly_bush_backport.sound.ModSounds;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.BushBlock;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.util.Direction;
|
||||
@ -80,13 +81,13 @@ public class FireflyBushBlock extends BushBlock implements IGrowable {
|
||||
}
|
||||
|
||||
private static Optional<BlockPos> findSpreadableNeighbourPos(World level, BlockPos blockPos, BlockState blockState) {
|
||||
return getSpreadableNeighbourPos(shuffledCopy((Direction[])Direction.Plane.HORIZONTAL.stream().toArray(), level.random), level, blockPos, blockState);
|
||||
return getSpreadableNeighbourPos(shuffledCopy(Direction.Plane.HORIZONTAL.stream().toArray(Direction[]::new), level.random), level, blockPos, blockState);
|
||||
}
|
||||
|
||||
private static Optional<BlockPos> getSpreadableNeighbourPos(List<Direction> directions, IBlockReader levelReader, BlockPos blockPos, BlockState blockState) {
|
||||
for (Direction direction : directions) {
|
||||
BlockPos blockPosDirection = blockPos.relative(direction);
|
||||
if (levelReader.getBlockState(blockPosDirection).isAir() && blockState.canSurvive((IWorldReader) levelReader, blockPosDirection)) {
|
||||
if (levelReader.getBlockState(blockPosDirection).is(Blocks.AIR) && blockState.canSurvive((IWorldReader) levelReader, blockPosDirection)) {
|
||||
return Optional.of(blockPosDirection);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user