aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2022-07-31 15:42:03 +0900
committerGitHub <noreply@github.com>2022-07-31 13:42:03 +0700
commitb7c74a9de643f7fe4dab08e081fa1e652671afe2 (patch)
tree87f35508a1b92aad89c75d94403cd50646280269 /src/main/java/gregtech/api/interfaces
parente0393cc3e77a28c657137cb636e488640f9a42c9 (diff)
downloadGT5-Unofficial-b7c74a9de643f7fe4dab08e081fa1e652671afe2.tar.gz
GT5-Unofficial-b7c74a9de643f7fe4dab08e081fa1e652671afe2.tar.bz2
GT5-Unofficial-b7c74a9de643f7fe4dab08e081fa1e652671afe2.zip
Fix clicking FluidDisplay not working with digital tank overflow mode (#1149)
Diffstat (limited to 'src/main/java/gregtech/api/interfaces')
-rw-r--r--src/main/java/gregtech/api/interfaces/IFluidAccess.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/interfaces/IFluidAccess.java b/src/main/java/gregtech/api/interfaces/IFluidAccess.java
index bbe198ddcb..01b6fb6d0b 100644
--- a/src/main/java/gregtech/api/interfaces/IFluidAccess.java
+++ b/src/main/java/gregtech/api/interfaces/IFluidAccess.java
@@ -9,4 +9,14 @@ public interface IFluidAccess {
FluidStack get();
int getCapacity();
+
+ default int getRealCapacity() {
+ return getCapacity();
+ }
+
+ default void addAmount(int amount) {
+ if (get() != null) {
+ get().amount = Math.min(get().amount + amount, getRealCapacity());
+ }
+ }
}