Use safer fluidstack comparisons in FluidIngredient (#6317)

* Use safer fluidstack comparisons

* switched to getFluid check
This commit is contained in:
TelepathicGrunt 2024-06-23 09:46:36 -04:00 committed by GitHub
parent d66170c8fe
commit 75d337ba8c
Failed to generate hash of commit

View file

@ -152,8 +152,7 @@ public abstract class FluidIngredient implements Predicate<FluidStack> {
@Override @Override
protected boolean testInternal(FluidStack t) { protected boolean testInternal(FluidStack t) {
if (!t.getFluid() if (t.getFluid() != fluid)
.isSame(fluid))
return false; return false;
if (tagToMatch.isEmpty()) if (tagToMatch.isEmpty())
return true; return true;
@ -206,8 +205,7 @@ public abstract class FluidIngredient implements Predicate<FluidStack> {
protected boolean testInternal(FluidStack t) { protected boolean testInternal(FluidStack t) {
if (tag == null) { if (tag == null) {
for (FluidStack accepted : getMatchingFluidStacks()) for (FluidStack accepted : getMatchingFluidStacks())
if (accepted.getFluid() if (accepted.getFluid() != t.getFluid())
.isSame(t.getFluid()))
return true; return true;
return false; return false;
} }