Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class CoreCrop extends BlockCrops
- {
- protected String name;
- public CoreCrop(String name)
- {
- this.name = name;
- setUnlocalizedName(this.name);
- setRegistryName(this.name);
- }
- public String getName()
- {
- return name;
- }
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
- {
- if(state == withAge(getMaxAge()))
- {
- world.getBlockState(pos).getBlock().harvestBlock(world, player, pos, state, null, ItemStack.EMPTY);
- world.setBlockState(pos, getDefaultState(), 3);
- return true;
- }
- return false;
- }
- @Override
- protected abstract int getBonemealAgeIncrease(World world);
- @Override
- public abstract Item getSeed();
- @Override
- public abstract Item getCrop();
- @Override
- public abstract int getMaxAge();
- @Override
- public abstract boolean isMaxAge(IBlockState state);
- @Override
- public abstract AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos);
- @Override
- protected abstract PropertyInteger getAgeProperty();
- @Override
- protected abstract BlockStateContainer createBlockState();
- }
Add Comment
Please, Sign In to add comment