- Powering smart chutes now disables output as well
This commit is contained in:
dithpri 2021-11-27 21:05:05 +01:00
parent df8f5449f0
commit dbb2f5729d
No known key found for this signature in database
GPG key ID: 0DF1F41337CD9775
2 changed files with 15 additions and 0 deletions

View file

@ -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<IItemHandler> grabCapability(Direction side) {
BlockPos pos = this.worldPosition.relative(side);

View file

@ -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<TileEntityBehaviour> behaviours) {