From 61318eeaf396d42b7bb337bcd7ab4cb9ad56f607 Mon Sep 17 00:00:00 2001 From: Tech22 <37029404+TechLord22@users.noreply.github.com> Date: Thu, 30 Dec 2021 08:52:57 -0500 Subject: [PATCH] logging for null material fluids --- .../java/gregtech/api/unification/material/Material.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/gregtech/api/unification/material/Material.java b/src/main/java/gregtech/api/unification/material/Material.java index 7ad5c740280..ea9402cb9e2 100644 --- a/src/main/java/gregtech/api/unification/material/Material.java +++ b/src/main/java/gregtech/api/unification/material/Material.java @@ -12,6 +12,7 @@ import gregtech.api.unification.material.info.MaterialIconSet; import gregtech.api.unification.material.properties.*; import gregtech.api.unification.stack.MaterialStack; +import gregtech.api.util.GTLog; import gregtech.api.util.LocalizationUtils; import gregtech.api.util.SmallDigits; import net.minecraft.enchantment.Enchantment; @@ -156,7 +157,12 @@ public Fluid getFluid() { FluidProperty prop = getProperty(PropertyKey.FLUID); if (prop == null) throw new IllegalArgumentException("Material " + materialInfo.name + " does not have a Fluid!"); - return prop.getFluid(); + + Fluid fluid = prop.getFluid(); + if (fluid == null) + GTLog.logger.warn("Material {} Fluid was null!", this); + + return fluid; } public FluidStack getFluid(int amount) {