Check rubber logs for sap from the ground level. (#2015)

Rubber logs can be put down manually, and it's not a given that the most bottom log is at the greenhouse's level.  In practice, with the ground made up out of rubber logs, there will be sap on logs at y == 0.
This commit is contained in:
Kato 2020-01-26 19:18:25 +01:00 committed by modmuss50
parent adf5c7aba2
commit 9e67ab5725

View file

@ -150,7 +150,7 @@ public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity
if (breakBlocks) world.breakBlock(blockPos.up(y), false);
}
} else if (block instanceof BlockRubberLog) {
for (int y = 1; (blockState = world.getBlockState(blockPos.up(y))).getBlock() == block && y < 10; y++) {
for (int y = 0; (blockState = world.getBlockState(blockPos.up(y))).getBlock() == block && y < 10; y++) {
if (blockState.get(BlockRubberLog.HAS_SAP)
&& canUseEnergy(TechRebornConfig.greenhouseControllerEnergyPerHarvest)
&& insertIntoInv(Collections.singletonList(TRContent.Parts.SAP.getStack()))