mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Cleanup some null checks and remove deprecated methods in Item and Block (#3429)
This commit is contained in:
1 parent
2823447b6e
commit
2bd8b95a3b
31 files changed
+175
-174
No files matched your search
@@ -29,6 +29,8 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* This is a fluid block implementation which emulates vanilla Minecraft fluid behavior.
|
||||
*
|
||||
@@ -78,7 +80,7 @@ public class BlockFluidClassic extends BlockFluidBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCollideCheck(IBlockState state, boolean fullHit)
|
||||
public boolean canCollideCheck(@Nonnull IBlockState state, boolean fullHit)
|
||||
{
|
||||
return fullHit && state.getValue(LEVEL) == 0;
|
||||
}
|
||||
@@ -90,7 +92,7 @@ public class BlockFluidClassic extends BlockFluidBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
public int getLightValue(@Nonnull IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos)
|
||||
{
|
||||
if (maxScaledLight == 0)
|
||||
{
|
||||
@@ -101,7 +103,7 @@ public class BlockFluidClassic extends BlockFluidBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand)
|
||||
public void updateTick(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull Random rand)
|
||||
{
|
||||
if (!isSourceBlock(world, pos) && ForgeEventFactory.canCreateFluidSource(world, pos, state, false))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user