This commit is contained in:
Shadows_of_Fire 2018-09-26 02:59:22 -04:00
parent 1cca640345
commit 1240287b3b

View file

@ -78,15 +78,14 @@ public class BlockGreenhouseGlass extends BlockBase {
if (world.canBlockSeeSky(pos) && world.isDaytime()) {
Triple<BlockPos, IBlockState, IGrowable> trip = firstBlock(world, pos);
boolean once = false;
for (int i = 0; i < 3; i++)
if (trip != null && trip.getRight().canGrow(world, trip.getLeft(), trip.getMiddle(), false)) {
trip.getRight().grow(world, rand, trip.getLeft(), trip.getMiddle());
for (int i = 0; i < 3; i++) {
IBlockState growState = i == 0 ? trip.getMiddle() : world.getBlockState(trip.getLeft());
if (trip != null && trip.getRight().canGrow(world, trip.getLeft(), growState, false)) {
trip.getRight().grow(world, rand, trip.getLeft(), growState);
once = true;
}
}
if (once) world.playEvent(2005, trip.getMiddle().isOpaqueCube() ? trip.getLeft().up() : trip.getLeft(), 0);
}
}