From dbb2f5729d00952d01ec07c9a32c8a11f947478f Mon Sep 17 00:00:00 2001 From: dithpri Date: Sat, 27 Nov 2021 21:05:05 +0100 Subject: [PATCH] Fix #2372 - Powering smart chutes now disables output as well --- .../content/logistics/block/chute/ChuteTileEntity.java | 9 +++++++++ .../logistics/block/chute/SmartChuteTileEntity.java | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java index c72b26ff8..028318c5f 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java @@ -354,6 +354,8 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor if (level == null) return false; + if (!this.canOutputItems()) + return false; if (!capBelow.isPresent()) capBelow = grabCapability(Direction.DOWN); if (capBelow.isPresent()) { @@ -407,6 +409,9 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor if (level == null) return false; + if (!this.canOutputItems()) + return false; + if (AbstractChuteBlock.isOpenChute(getBlockState())) { if (!capAbove.isPresent()) capAbove = grabCapability(Direction.UP); @@ -476,6 +481,10 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor protected boolean canCollectItemsFromBelow() { return true; } + + protected boolean canOutputItems() { + return true; + } private LazyOptional grabCapability(Direction side) { BlockPos pos = this.worldPosition.relative(side); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/chute/SmartChuteTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/chute/SmartChuteTileEntity.java index 610577a49..a740833cf 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/chute/SmartChuteTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/chute/SmartChuteTileEntity.java @@ -41,6 +41,12 @@ public class SmartChuteTileEntity extends ChuteTileEntity { BlockState blockState = getBlockState(); return blockState.hasProperty(SmartChuteBlock.POWERED) && !blockState.getValue(SmartChuteBlock.POWERED); } + + @Override + protected boolean canOutputItems() { + BlockState blockState = getBlockState(); + return blockState.hasProperty(SmartChuteBlock.POWERED) && !blockState.getValue(SmartChuteBlock.POWERED); + } @Override public void addBehaviours(List behaviours) {