mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-21 12:42:50 +00:00
Get rid of all the nullable-nonnull stuff, warning huge diff
This commit is contained in:
344 files changed
+1603
-582
No files matched your search
@@ -38,6 +38,7 @@ import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -51,13 +52,14 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, BotaniaStateProps.ALTGRASS_VARIANT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isToolEffective(String type, IBlockState state) {
|
||||
public boolean isToolEffective(String type, @Nonnull IBlockState state) {
|
||||
return type.equals("shovel");
|
||||
}
|
||||
|
||||
@@ -66,6 +68,7 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
return state.getValue(BotaniaStateProps.ALTGRASS_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.values()[meta]);
|
||||
@@ -77,7 +80,7 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for(int i = 0; i < 6; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
@@ -102,13 +105,14 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
return Blocks.DIRT.getItemDropped(state, p_149650_2_, p_149650_3_);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable) {
|
||||
public boolean canSustainPlant(@Nonnull IBlockState state, @Nonnull IBlockAccess world, BlockPos pos, @Nonnull EnumFacing direction, IPlantable plantable) {
|
||||
EnumPlantType type = plantable.getPlantType(world, pos.down());
|
||||
return type == EnumPlantType.Plains || type == EnumPlantType.Beach;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user