Ejemplo n.º 1
0
 /**
  * Base chance for dropping seeds when the plant is picked. Default is 0.5*0.8^tier with a bigger
  * chance for sizes greater than 2 and absolutely no chance for size 0.
  *
  * @param crop reference to ICropTile
  * @return Chance to drop the seeds
  */
 public float dropSeedChance(ICropTile crop) {
   if (crop.getSize() == 1) return 0;
   float base = 0.5F;
   if (crop.getSize() == 2) base /= 2F;
   for (int i = 0; i < tier(); i++) {
     base *= 0.8;
   }
   return base;
 }
Ejemplo n.º 2
0
 /**
  * Check whether this plant spreads weed to surrounding tiles. Default is true if the plant has a
  * high growth stat (or is weeds) and size greater or equal than 2.
  *
  * @param crop reference to ICropTile
  * @return Whether the plant spreads weed
  */
 public boolean isWeed(ICropTile crop) {
   return crop.getSize() >= 2 && (crop.getID() == 0 || crop.getGrowth() >= 24);
 }
Ejemplo n.º 3
0
 /**
  * Used to determine whether the plant can crossbreed with another crop. Default is allow
  * crossbreeding if the size is greater or equal than 3.
  *
  * @param crop crop to crossbreed with
  */
 public boolean canCross(ICropTile crop) {
   return crop.getSize() >= 3;
 }
Ejemplo n.º 4
0
  /**
   * Sprite the crop is meant to be rendered with.
   *
   * @param crop reference to ICropTile
   * @return 0-255, representing the sprite index on the crop's spritesheet.
   */
  @SideOnly(Side.CLIENT)
  public IIcon getSprite(ICropTile crop) {
    if (crop.getSize() <= 0 || crop.getSize() > textures.length) return null;

    return textures[crop.getSize() - 1];
  }