From 48f533e2d450905e23a5541716d4017777fc8f28 Mon Sep 17 00:00:00 2001 From: Bedrockbreaker Date: Sun, 3 Mar 2024 21:58:47 -0700 Subject: [PATCH] Git didn't recognize these --- .../java/mekanism/api/gas/GasTankInfo.java | 28 +++++++++++++++++++ .../api/gas/IGasTankInfoProvider.java | 23 +++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/main/java/mekanism/api/gas/GasTankInfo.java create mode 100644 src/main/java/mekanism/api/gas/IGasTankInfoProvider.java diff --git a/src/main/java/mekanism/api/gas/GasTankInfo.java b/src/main/java/mekanism/api/gas/GasTankInfo.java new file mode 100644 index 000000000..3175d060c --- /dev/null +++ b/src/main/java/mekanism/api/gas/GasTankInfo.java @@ -0,0 +1,28 @@ +package mekanism.api.gas; + +import javax.annotation.Nullable; + +public interface GasTankInfo { + + /** + * Retrieve the stored gas stack. DO NOT MODIFY. + * + * @return the stored gas, or null + */ + @Nullable + GasStack getGas(); + + /** + * Gets the amount of gas stored by this GasTank + * + * @return amount of gas stored + */ + int getStored(); + + /** + * Gets the maximum amount of gas this tank can hold + * + * @return - max gas + */ + int getMaxGas(); +} diff --git a/src/main/java/mekanism/api/gas/IGasTankInfoProvider.java b/src/main/java/mekanism/api/gas/IGasTankInfoProvider.java new file mode 100644 index 000000000..886e586a1 --- /dev/null +++ b/src/main/java/mekanism/api/gas/IGasTankInfoProvider.java @@ -0,0 +1,23 @@ +package mekanism.api.gas; + +import javax.annotation.Nonnull; + +/** + * Implement this if your tile entity extends IGasHandler. + * Backported from 1.12.2, separated from IGasHandler to maintain compatibility. + */ +public interface IGasTankInfoProvider +{ + + GasTankInfo[] NONE = new GasTankInfo[0]; + + /** + * Gets the tanks present on this handler. READ ONLY. DO NOT MODIFY. + * + * @return an array of GasTankInfo elements corresponding to all tanks. + */ + @Nonnull + default GasTankInfo[] getTankInfo() { + return NONE; + } +}