Skip to content

Commit 5159860

Browse files
committed
hopefully fixed #793
A better solution is port our refartored filter system from 1.21.1. However, currently I am not putting many effort on 0.7 version.
1 parent 68d8a5d commit 5159860

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# eclipse
22
bin
33
*.launch
4-
.settings
5-
.metadata
64
.classpath
5+
.factorypath
6+
.metadata
77
.project
8+
.settings
89

910
# idea
1011
out

src/main/java/de/srendi/advancedperipherals/common/util/inventory/InventoryUtil.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ public static int moveFluid(IFluidHandler inventoryFrom, IFluidHandler inventory
126126
if (inventoryTo instanceof IStorageSystemFluidHandler storageSystemHandler) {
127127
if (filter.test(inventoryFrom.getFluidInTank(0))) {
128128
FluidStack toExtract = inventoryFrom.getFluidInTank(0).copy();
129+
if (toExtract.isEmpty()) {
130+
return 0;
131+
}
129132
toExtract.setAmount(amount);
130133
FluidStack extracted = inventoryFrom.drain(toExtract, IFluidHandler.FluidAction.SIMULATE);
131134
if (extracted.isEmpty())

0 commit comments

Comments
 (0)