Add null check to chutes

This commit is contained in:
reidbhuntley 2021-12-22 21:30:30 -05:00
parent bf59956f23
commit 7791d340e1

View File

@ -352,9 +352,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
ChuteTileEntity targetChute = getTargetChute(blockState);
Direction direction = AbstractChuteBlock.getChuteFacing(blockState);
if (level == null)
return false;
if (!this.canOutputItems())
if (level == null || direction == null || !this.canOutputItems())
return false;
if (!capBelow.isPresent())
capBelow = grabCapability(Direction.DOWN);
@ -406,10 +404,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
private boolean handleUpwardOutput(boolean simulate) {
BlockState stateAbove = level.getBlockState(worldPosition.above());
if (level == null)
return false;
if (!this.canOutputItems())
if (level == null || !this.canOutputItems())
return false;
if (AbstractChuteBlock.isOpenChute(getBlockState())) {