mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Don't crash if we hit the void
This commit is contained in:
parent
0a76d0a070
commit
df374a42de
1 changed files with 2 additions and 2 deletions
|
@ -79,8 +79,7 @@ public class BlockGreenhouseGlass extends BlockBase {
|
|||
if (world.canBlockSeeSky(pos) && world.isDaytime()) {
|
||||
Triple<BlockPos, IBlockState, IGrowable> trip = firstBlock(world, pos);
|
||||
boolean once = false;
|
||||
if(trip != null)
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (trip != null) for (int i = 0; i < 3; i++) {
|
||||
IBlockState growState = i == 0 ? trip.getMiddle() : world.getBlockState(trip.getLeft());
|
||||
if (trip.getRight().canGrow(world, trip.getLeft(), growState, false)) {
|
||||
trip.getRight().grow(world, rand, trip.getLeft(), growState);
|
||||
|
@ -95,6 +94,7 @@ public class BlockGreenhouseGlass extends BlockBase {
|
|||
BlockPos.MutableBlockPos mut = new BlockPos.MutableBlockPos(glassPos);
|
||||
while (true) {
|
||||
mut.setPos(mut.getX(), mut.getY() - 1, mut.getZ());
|
||||
if (mut.getY() < 0) return null;
|
||||
IBlockState state = world.getBlockState(mut);
|
||||
if (!state.isOpaqueCube() || state.getBlock() instanceof IGrowable) {
|
||||
if (state.getBlock() instanceof IGrowable) return Triple.of(mut.toImmutable(), state, (IGrowable) state.getBlock());
|
||||
|
|
Loading…
Reference in a new issue