mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-10-25 20:32:20 +00:00
Fix NPE on GT fluid display without NBT (#1057)
This commit is contained in:
1 parent
11f9194de9
commit
3a4a6734dc
2 files changed
+15
-1
No files matched your search
@@ -131,7 +131,14 @@ public class StackInfo {
|
||||
}
|
||||
|
||||
if (isFluidDisplayItem(stackA)) {
|
||||
return isFluidDisplayItem(stackB) && getFluid(stackA).isFluidEqual(getFluid(stackB));
|
||||
|
||||
if (isFluidDisplayItem(stackB)) {
|
||||
final FluidStack fluidA = getFluid(stackA);
|
||||
final FluidStack fluidB = getFluid(stackB);
|
||||
return fluidA != null && fluidA.isFluidEqual(fluidB);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (stackA.getItem() != stackB.getItem()) {
|
||||
|
||||
@@ -21,6 +21,7 @@ public class GTFluidStackStringifyHandler implements IStackStringifyHandler {
|
||||
protected static Method getFluidFromDisplayStack = null;
|
||||
protected static Class<?> gtMetaGeneratedTool = null;
|
||||
protected static Field playSound = null;
|
||||
private static boolean loggedNoNbtDisplay = false;
|
||||
|
||||
static {
|
||||
try {
|
||||
@@ -88,6 +89,12 @@ public class GTFluidStackStringifyHandler implements IStackStringifyHandler {
|
||||
return (FluidStack) obj;
|
||||
}
|
||||
|
||||
final Fluid fluid = FluidRegistry.getFluid(stack.getItemDamage());
|
||||
|
||||
if (fluid != null) {
|
||||
return new FluidStack(fluid, 0);
|
||||
}
|
||||
|
||||
} else if (item == GameRegistry.findItem("ae2fc", "fluid_packet")) {
|
||||
NBTTagCompound nbtTag = stack.getTagCompound();
|
||||
|
||||
|
||||
Reference in new issue
Block a user