mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 20:11:35 +01:00
Merge pull request #1340 from sarim/mc1.15/dev
allow smart chute to transfer whole stacks
This commit is contained in:
commit
9ab5c74929
2 changed files with 5 additions and 2 deletions
|
@ -72,6 +72,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
ChuteItemHandler itemHandler;
|
ChuteItemHandler itemHandler;
|
||||||
LazyOptional<IItemHandler> lazyHandler;
|
LazyOptional<IItemHandler> lazyHandler;
|
||||||
boolean canPickUpItems;
|
boolean canPickUpItems;
|
||||||
|
boolean canFilterItems;
|
||||||
|
|
||||||
float bottomPullDistance;
|
float bottomPullDistance;
|
||||||
float beltBelowOffset;
|
float beltBelowOffset;
|
||||||
|
@ -90,6 +91,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
itemHandler = new ChuteItemHandler(this);
|
itemHandler = new ChuteItemHandler(this);
|
||||||
lazyHandler = LazyOptional.of(() -> itemHandler);
|
lazyHandler = LazyOptional.of(() -> itemHandler);
|
||||||
canPickUpItems = false;
|
canPickUpItems = false;
|
||||||
|
canFilterItems = false;
|
||||||
capAbove = LazyOptional.empty();
|
capAbove = LazyOptional.empty();
|
||||||
capBelow = LazyOptional.empty();
|
capBelow = LazyOptional.empty();
|
||||||
bottomPullDistance = 0;
|
bottomPullDistance = 0;
|
||||||
|
@ -331,7 +333,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
IItemHandler inv = capAbove.orElse(null);
|
IItemHandler inv = capAbove.orElse(null);
|
||||||
Predicate<ItemStack> canAccept = this::canAcceptItem;
|
Predicate<ItemStack> canAccept = this::canAcceptItem;
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
item = ItemHelper.extract(inv, canAccept, ExtractionCountMode.UPTO, 16, false);
|
item = ItemHelper.extract(inv, canAccept, ExtractionCountMode.UPTO, canFilterItems ? 64 : 16, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,7 +353,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
Predicate<ItemStack> canAccept = this::canAcceptItem;
|
Predicate<ItemStack> canAccept = this::canAcceptItem;
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
item = ItemHelper.extract(inv, canAccept, ExtractionCountMode.UPTO, 16, false);
|
item = ItemHelper.extract(inv, canAccept, ExtractionCountMode.UPTO, canFilterItems ? 64 : 16, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ public class SmartChuteTileEntity extends ChuteTileEntity {
|
||||||
|
|
||||||
public SmartChuteTileEntity(TileEntityType<?> tileEntityTypeIn) {
|
public SmartChuteTileEntity(TileEntityType<?> tileEntityTypeIn) {
|
||||||
super(tileEntityTypeIn);
|
super(tileEntityTypeIn);
|
||||||
|
canFilterItems = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue