This commit is contained in:
Brennan Ward 2019-08-29 18:44:13 -04:00
parent a296419857
commit f12e83a4d0

View file

@ -94,13 +94,13 @@ public class BlockGreenhouseGlass extends BlockBase {
} }
} }
public static Triple<BlockPos, IBlockState, IGrowable> firstBlock(World world, BlockPos glassPos) { public Triple<BlockPos, IBlockState, IGrowable> firstBlock(World world, BlockPos glassPos) {
BlockPos.MutableBlockPos mut = new BlockPos.MutableBlockPos(glassPos); BlockPos.MutableBlockPos mut = new BlockPos.MutableBlockPos(glassPos);
while (true) { while (true) {
mut.setPos(mut.getX(), mut.getY() - 1, mut.getZ()); mut.setPos(mut.getX(), mut.getY() - 1, mut.getZ());
if (mut.getY() < 0) return null; if (mut.getY() < 0) return null;
IBlockState state = world.getBlockState(mut); IBlockState state = world.getBlockState(mut);
if (state.isOpaqueCube() || state.getBlock() instanceof IGrowable) { if (state.isOpaqueCube() || state.getBlock() instanceof IGrowable || state.getBlock() == this) {
if (state.getBlock() instanceof IGrowable) return Triple.of(mut.toImmutable(), state, (IGrowable) state.getBlock()); if (state.getBlock() instanceof IGrowable) return Triple.of(mut.toImmutable(), state, (IGrowable) state.getBlock());
else return null; else return null;
} }