Correctly filtering neifluids (#1027)

This commit is contained in:
slprime authored and GitHub committed 2026-09-10 22:52:37 +03:00
1 parent 2bf5a1cf9f
commit af6dba1269
5 files changed
+43 -13

No files matched your search

@@ -126,7 +126,15 @@ public class StackInfo {
}
public static boolean equalItemAndNBT(ItemStack stackA, ItemStack stackB, boolean useNBT) {
if (stackA == null || stackB == null || stackA.getItem() != stackB.getItem()) {
if (stackA == null || stackB == null) {
return false;
}
if (isFluidDisplayItem(stackA)) {
return isFluidDisplayItem(stackB) && getFluid(stackA).isFluidEqual(getFluid(stackB));
}
if (stackA.getItem() != stackB.getItem()) {
return false;
}
@@ -158,7 +166,8 @@ public class StackInfo {
}
public static boolean isFluidContainer(ItemStack stack) {
return stack.getItem() instanceof IFluidContainerItem || FluidContainerRegistry.isContainer(stack);
return stack.getItem() instanceof IFluidContainerItem && !isFluidDisplayItem(stack)
|| FluidContainerRegistry.isContainer(stack);
}
public static String getItemStackGUID(ItemStack stack) {