Skip to content

Commit

Permalink
logging for null material fluids
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 committed Dec 30, 2021
1 parent 11ce60b commit 61318ee
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 61318ee

Please sign in to comment.