mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-28 16:06:48 +01:00
Merge pull request #2384 from dithpri/smart-chute-fix
Fix powered smart chutes outputting items
This commit is contained in:
commit
14d15089db
2 changed files with 15 additions and 0 deletions
|
@ -354,6 +354,8 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
|
|
||||||
if (level == null)
|
if (level == null)
|
||||||
return false;
|
return false;
|
||||||
|
if (!this.canOutputItems())
|
||||||
|
return false;
|
||||||
if (!capBelow.isPresent())
|
if (!capBelow.isPresent())
|
||||||
capBelow = grabCapability(Direction.DOWN);
|
capBelow = grabCapability(Direction.DOWN);
|
||||||
if (capBelow.isPresent()) {
|
if (capBelow.isPresent()) {
|
||||||
|
@ -407,6 +409,9 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
if (level == null)
|
if (level == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!this.canOutputItems())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (AbstractChuteBlock.isOpenChute(getBlockState())) {
|
if (AbstractChuteBlock.isOpenChute(getBlockState())) {
|
||||||
if (!capAbove.isPresent())
|
if (!capAbove.isPresent())
|
||||||
capAbove = grabCapability(Direction.UP);
|
capAbove = grabCapability(Direction.UP);
|
||||||
|
@ -476,6 +481,10 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
protected boolean canCollectItemsFromBelow() {
|
protected boolean canCollectItemsFromBelow() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean canOutputItems() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private LazyOptional<IItemHandler> grabCapability(Direction side) {
|
private LazyOptional<IItemHandler> grabCapability(Direction side) {
|
||||||
BlockPos pos = this.worldPosition.relative(side);
|
BlockPos pos = this.worldPosition.relative(side);
|
||||||
|
|
|
@ -41,6 +41,12 @@ public class SmartChuteTileEntity extends ChuteTileEntity {
|
||||||
BlockState blockState = getBlockState();
|
BlockState blockState = getBlockState();
|
||||||
return blockState.hasProperty(SmartChuteBlock.POWERED) && !blockState.getValue(SmartChuteBlock.POWERED);
|
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
|
@Override
|
||||||
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
|
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
|
||||||
|
|
Loading…
Reference in a new issue