Advertisement
Boy132

CoreCorn

Apr 19th, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 KB | None | 0 0
  1. public class CropCorn extends CoreDoubleCrop
  2. {
  3.     public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 4);
  4.  
  5.     private Item seed;
  6.     private Item crop;
  7.    
  8.     public CropCorn(String name)
  9.     {
  10.         super(name + "_plant");
  11.         this.seed = new CoreSeedFood(name, 3, this);
  12.         this.crop = seed;
  13.     }
  14.    
  15.     @Override
  16.     protected int getBonemealAgeIncrease(World world)
  17.     {
  18.         return MathHelper.getInt(world.rand, 1, 3);
  19.     }
  20.  
  21.     @Override
  22.     public Item getSeed()
  23.     {
  24.         return seed;
  25.     }
  26.  
  27.     @Override
  28.     public Item getCrop()
  29.     {
  30.         return crop;
  31.     }
  32.  
  33.     @Override
  34.     public int getMaxAge()
  35.     {
  36.         return 4;
  37.     }
  38.    
  39.     @Override
  40.     public boolean isMaxAge(IBlockState state)
  41.     {
  42.         return getAge(state) >= getMaxAge();
  43.     }
  44.  
  45.     @Override
  46.     public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
  47.     {
  48.         return FULL_BLOCK_AABB;
  49.     }
  50.    
  51.     @Override
  52.     protected PropertyInteger getAgeProperty()
  53.     {
  54.         return AGE;
  55.     }
  56.  
  57.     @Override
  58.     protected BlockStateContainer createBlockState()
  59.     {
  60.         return new BlockStateContainer(this, new IProperty[] {AGE, HALF});
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement