From 463854a2c011f555fe391f7ba407ba695bf5d7d5 Mon Sep 17 00:00:00 2001 From: Sarim Khan Date: Sat, 3 Apr 2021 21:53:39 +0600 Subject: [PATCH] allow smart chute to transfer whole stacks --- .../content/logistics/block/chute/ChuteTileEntity.java | 6 ++++-- .../content/logistics/block/chute/SmartChuteTileEntity.java | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) 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 9b21c5b09..09fa728fa 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 @@ -72,6 +72,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor ChuteItemHandler itemHandler; LazyOptional 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 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 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; } 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 07cbb4fcb..ed0571239 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 @@ -17,6 +17,7 @@ public class SmartChuteTileEntity extends ChuteTileEntity { public SmartChuteTileEntity(TileEntityType tileEntityTypeIn) { super(tileEntityTypeIn); + canFilterItems = true; } @Override