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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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