Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CropCorn extends CoreDoubleCrop
- {
- public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 4);
- private Item seed;
- private Item crop;
- public CropCorn(String name)
- {
- super(name + "_plant");
- this.seed = new CoreSeedFood(name, 3, this);
- this.crop = seed;
- }
- @Override
- protected int getBonemealAgeIncrease(World world)
- {
- return MathHelper.getInt(world.rand, 1, 3);
- }
- @Override
- public Item getSeed()
- {
- return seed;
- }
- @Override
- public Item getCrop()
- {
- return crop;
- }
- @Override
- public int getMaxAge()
- {
- return 4;
- }
- @Override
- public boolean isMaxAge(IBlockState state)
- {
- return getAge(state) >= getMaxAge();
- }
- @Override
- public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
- {
- return FULL_BLOCK_AABB;
- }
- @Override
- protected PropertyInteger getAgeProperty()
- {
- return AGE;
- }
- @Override
- protected BlockStateContainer createBlockState()
- {
- return new BlockStateContainer(this, new IProperty[] {AGE, HALF});
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement