aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java
diff options
context:
space:
mode:
authorLéa Gris <lea.gris@noiraude.net>2022-09-08 08:11:18 +0200
committerGitHub <noreply@github.com>2022-09-08 08:11:18 +0200
commitd0ecbfa6e361b354ef7074ba8194510fc257c352 (patch)
tree09bfcac07d604060d115c9b37fb724c3296ca9f6 /src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java
parentf14ab9d942ee11aff20f5d328b57d26c77c96cb7 (diff)
downloadGT5-Unofficial-d0ecbfa6e361b354ef7074ba8194510fc257c352.tar.gz
GT5-Unofficial-d0ecbfa6e361b354ef7074ba8194510fc257c352.tar.bz2
GT5-Unofficial-d0ecbfa6e361b354ef7074ba8194510fc257c352.zip
fix(API): GT_Fluid (#1349)
* fix(API): GT_Fluid - Fix: Use registeredFluid instead of GT_Fluid to configure Materials and containers to prevent crashes when retrieving fluids referrences from those. - Impr: Adjust fluid luminosity computation to better fit with Tungsten as maximum - Impr: Remove transparency from the fluid.molten.autogenerated.png texture to prevent molten materials to appear dilluted. * ./gradlew :spotlessApply * rev(comment): address review comment from @Glease rev: https://github.com/GTNewHorizons/GT5-Unofficial/pull/1349#pullrequestreview-1098651647 fix: Logic to handle working with own registered fluids and already registered fluids. imp: Some IGT_Fluid methods requires the fluid to be registered, throws an IllegalStateException on use at an unregistered fluid. imp: Normalizes @inheritDoc no additionnal text allowed
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java')
-rw-r--r--src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java b/src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java
index 1a34b44b5a..5529e111bb 100644
--- a/src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java
+++ b/src/main/java/gregtech/api/interfaces/fluid/IGT_Fluid.java
@@ -8,10 +8,11 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
+@SuppressWarnings("unused") // API might legitimately expose unused methods within this local project's scope
public interface IGT_Fluid {
/**
- * Registers this {@link IGT_Fluid} to ths {@link FluidRegistry}
+ * Adds this {@link IGT_Fluid} to the {@link FluidRegistry} and internally-implemented registrations
*
* @return {@link IGT_Fluid} self for call chaining
*/
@@ -24,6 +25,8 @@ public interface IGT_Fluid {
* @param emptyContainer The empty fluid container
* @param containerSize The size of the container
* @return The {@link IGT_Fluid} for chaining
+ *
+ * @throws IllegalStateException on attempt to register containers for an unregistered fluid
*/
IGT_Fluid registerContainers(
final ItemStack fullContainer, final ItemStack emptyContainer, final int containerSize);
@@ -34,6 +37,8 @@ public interface IGT_Fluid {
* @param fullContainer The full container to associate with this {@link IGT_Fluid}
* @param emptyContainer The empty container associate with this {@link IGT_Fluid}
* @return {@link IGT_Fluid} self for call chaining
+ *
+ * @throws IllegalStateException on attempt to register containers for an unregistered fluid
*/
IGT_Fluid registerBContainers(final ItemStack fullContainer, final ItemStack emptyContainer);
@@ -43,6 +48,8 @@ public interface IGT_Fluid {
* @param fullContainer The full container to associate with this {@link IGT_Fluid}
* @param emptyContainer The empty container associate with this {@link IGT_Fluid}
* @return {@link IGT_Fluid} self for call chaining
+ *
+ * @throws IllegalStateException on attempt to register containers for an unregistered fluid
*/
IGT_Fluid registerPContainers(final ItemStack fullContainer, final ItemStack emptyContainer);
@@ -51,6 +58,9 @@ public interface IGT_Fluid {
*
* @param material the {@link Materials} to configure based on this {@link IGT_Fluid} and {@link FluidState}
* @return The {@link IGT_Fluid} for chaining
+ *
+ * @throws IllegalStateException on unknown {@link FluidState}
+ * @throws IllegalStateException on attempt to register containers for an unregistered fluid
*/
IGT_Fluid configureMaterials(final Materials material);