allow smart chute to transfer whole stacks

This commit is contained in:
Sarim Khan 2021-04-03 21:53:39 +06:00
parent 75f2516408
commit 463854a2c0
No known key found for this signature in database
GPG key ID: 6AAF1063753AD8EE
2 changed files with 5 additions and 2 deletions

View file

@ -72,6 +72,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
ChuteItemHandler itemHandler;
LazyOptional<IItemHandler> lazyHandler;
boolean canPickUpItems;
boolean canFilterItems;
float bottomPullDistance;
float beltBelowOffset;
@ -90,6 +91,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
itemHandler = new ChuteItemHandler(this);
lazyHandler = LazyOptional.of(() -> itemHandler);
canPickUpItems = false;
canFilterItems = false;
capAbove = LazyOptional.empty();
capBelow = LazyOptional.empty();
bottomPullDistance = 0;
@ -331,7 +333,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
IItemHandler inv = capAbove.orElse(null);
Predicate<ItemStack> canAccept = this::canAcceptItem;
if (count == 0) {
item = ItemHelper.extract(inv, canAccept, ExtractionCountMode.UPTO, 16, false);
item = ItemHelper.extract(inv, canAccept, ExtractionCountMode.UPTO, canFilterItems ? 64 : 16, false);
return;
}
@ -351,7 +353,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
Predicate<ItemStack> canAccept = this::canAcceptItem;
if (count == 0) {
item = ItemHelper.extract(inv, canAccept, ExtractionCountMode.UPTO, 16, false);
item = ItemHelper.extract(inv, canAccept, ExtractionCountMode.UPTO, canFilterItems ? 64 : 16, false);
return;
}

View file

@ -17,6 +17,7 @@ public class SmartChuteTileEntity extends ChuteTileEntity {
public SmartChuteTileEntity(TileEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
canFilterItems = true;
}
@Override