mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 18:54:45 +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
@@ -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