mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
And handle the null case in the constructor itself. Closes #1794 (again)
This commit is contained in:
1 parent
230d757a89
commit
5c88164211
1 file changed
+6
-1
@@ -23,7 +23,12 @@ public class FluidStack
|
||||
|
||||
public FluidStack(Fluid fluid, int amount)
|
||||
{
|
||||
if (!FluidRegistry.isFluidRegistered(fluid))
|
||||
if (fluid == null)
|
||||
{
|
||||
FMLLog.bigWarning("Null fluid supplied to fluidstack. Did you try and create a stack for an unregistered fluid?");
|
||||
throw new IllegalArgumentException("Cannot create a fluidstack from a null fluid");
|
||||
}
|
||||
else if (!FluidRegistry.isFluidRegistered(fluid))
|
||||
{
|
||||
FMLLog.bigWarning("Failed attempt to create a FluidStack for an unregistered Fluid %s (type %s)", fluid.getName(), fluid.getClass().getName());
|
||||
throw new IllegalArgumentException("Cannot create a fluidstack from an unregistered fluid");
|
||||
|
||||
Reference in new issue
Block a user