aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub <53441451+kuba6000@users.noreply.github.com>2024-06-26 19:44:38 +0200
committerGitHub <noreply@github.com>2024-06-26 19:44:38 +0200
commit309f035a3d2f1922808a82fd59024d3c34c3f0f7 (patch)
treef0efaa06acb7ea2c7900b93eeabb129b078a1a91
parent8903afda2ba42a9b13f6a22a18df33b4cbe28576 (diff)
downloadGT5-Unofficial-309f035a3d2f1922808a82fd59024d3c34c3f0f7.tar.gz
GT5-Unofficial-309f035a3d2f1922808a82fd59024d3c34c3f0f7.tar.bz2
GT5-Unofficial-309f035a3d2f1922808a82fd59024d3c34c3f0f7.zip
Fix dupe bug in YOTHatch (#2656)
* Fix dupe bug in YOTHatch * Proper implementation of injectItems
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java
index f905e82f8c..2625934256 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java
@@ -169,11 +169,13 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
@Override
public IAEFluidStack injectItems(IAEFluidStack input, Actionable type, BaseActionSource src) {
- long amt = fill(null, input, false);
- if (amt == input.getStackSize()) {
- if (type.equals(Actionable.MODULATE)) fill(null, input, true);
- return null;
+ long amt = fill(null, input, type.equals(Actionable.MODULATE));
+ if (amt == 0) {
+ return input;
}
+ input = input.copy();
+ input.decStackSize(amt);
+ if (input.getStackSize() <= 0) return null;
return input;
}
@@ -262,7 +264,7 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
final BigInteger delta = host.mStorage.subtract(host.mStorageCurrent);
returned = delta.intValueExact();
}
- host.mStorageCurrent = host.mStorage;
+ if (doFill) host.mStorageCurrent = host.mStorage;
return returned;
}
}
@@ -291,7 +293,7 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl
final BigInteger delta = host.mStorage.subtract(host.mStorageCurrent);
returned = delta.longValueExact();
}
- host.mStorageCurrent = host.mStorage;
+ if (doFill) host.mStorageCurrent = host.mStorage;
return returned;
}
}