mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 18:45:09 +00:00
Clean up null issues, add more annotations (#3590)
This commit is contained in:
1 parent
43efa3cfc4
commit
c545b8ecd4
130 files changed
+629
-262
No files matched your search
@@ -237,6 +237,7 @@ public class FluidTank implements IFluidTank, IFluidHandler
|
||||
* Use this method to bypass the restrictions from {@link #canDrainFluidType(FluidStack)}
|
||||
* Meant for use by the owner of the tank when they have {@link #canDrain()} set to false}.
|
||||
*/
|
||||
@Nullable
|
||||
public FluidStack drainInternal(FluidStack resource, boolean doDrain)
|
||||
{
|
||||
if (resource == null || !resource.isFluidEqual(getFluid()))
|
||||
@@ -250,6 +251,7 @@ public class FluidTank implements IFluidTank, IFluidHandler
|
||||
* Use this method to bypass the restrictions from {@link #canDrainFluidType(FluidStack)}
|
||||
* Meant for use by the owner of the tank when they have {@link #canDrain()} set to false}.
|
||||
*/
|
||||
@Nullable
|
||||
public FluidStack drainInternal(int maxDrain, boolean doDrain)
|
||||
{
|
||||
if (fluid == null || maxDrain <= 0)
|
||||
@@ -343,9 +345,9 @@ public class FluidTank implements IFluidTank, IFluidHandler
|
||||
*
|
||||
* @see IFluidTankProperties#canDrainFluidType(FluidStack)
|
||||
*/
|
||||
public boolean canDrainFluidType(FluidStack fluid)
|
||||
public boolean canDrainFluidType(@Nullable FluidStack fluid)
|
||||
{
|
||||
return canDrain();
|
||||
return fluid != null && canDrain();
|
||||
}
|
||||
|
||||
protected void onContentsChanged()
|
||||
|
||||
Reference in new issue
Block a user