diff --git a/src/main/java/com/simibubi/create/foundation/fluid/FluidHelper.java b/src/main/java/com/simibubi/create/foundation/fluid/FluidHelper.java index befb004b2..5d54e13cf 100644 --- a/src/main/java/com/simibubi/create/foundation/fluid/FluidHelper.java +++ b/src/main/java/com/simibubi/create/foundation/fluid/FluidHelper.java @@ -49,6 +49,14 @@ public class FluidHelper { public static boolean isLava(Fluid fluid) { return convertToStill(fluid) == Fluids.LAVA; } + + public static boolean isSame(FluidStack fluidStack, FluidStack fluidStack2) { + return fluidStack.getFluid() == fluidStack2.getFluid(); + } + + public static boolean isSame(FluidStack fluidStack, Fluid fluid) { + return fluidStack.getFluid() == fluid; + } @SuppressWarnings("deprecation") public static boolean isTag(Fluid fluid, TagKey tag) { diff --git a/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java b/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java index 0a6fcca97..9f1eccaf0 100644 --- a/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java +++ b/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java @@ -152,7 +152,7 @@ public abstract class FluidIngredient implements Predicate { @Override protected boolean testInternal(FluidStack t) { - if (t.getFluid() != fluid) + if (!FluidHelper.isSame(t, fluid)) return false; if (tagToMatch.isEmpty()) return true; @@ -200,16 +200,14 @@ public abstract class FluidIngredient implements Predicate { protected TagKey tag; - @SuppressWarnings("deprecation") @Override protected boolean testInternal(FluidStack t) { - if (tag == null) { - for (FluidStack accepted : getMatchingFluidStacks()) - if (accepted.getFluid() != t.getFluid()) - return true; - return false; - } - return t.getFluid().is(tag); + if (tag != null) + return FluidHelper.isTag(t, tag); + for (FluidStack accepted : getMatchingFluidStacks()) + if (FluidHelper.isSame(accepted, t)) + return true; + return false; } @Override