diff options
| author | miozune <miozune@gmail.com> | 2022-07-31 15:42:03 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-31 13:42:03 +0700 |
| commit | b7c74a9de643f7fe4dab08e081fa1e652671afe2 (patch) | |
| tree | 87f35508a1b92aad89c75d94403cd50646280269 /src/main/java/gregtech/api/interfaces | |
| parent | e0393cc3e77a28c657137cb636e488640f9a42c9 (diff) | |
| download | GT5-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.java | 10 |
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()); + } + } } |
