Ejemplo n.º 1
0
 public void func_71914_a(
     World p_71914_1_,
     int p_71914_2_,
     int p_71914_3_,
     int p_71914_4_,
     int p_71914_5_,
     float p_71914_6_,
     int p_71914_7_) {
   super.func_71914_a(p_71914_1_, p_71914_2_, p_71914_3_, p_71914_4_, p_71914_5_, p_71914_6_, 0);
   if (p_71914_1_.field_72995_K) {
     return;
   }
   int i = 3 + p_71914_7_;
   for (int j = 0; j < i; j++) {
     if (p_71914_1_.field_73012_v.nextInt(15) <= p_71914_5_) {
       float f = 0.7F;
       float f1 = p_71914_1_.field_73012_v.nextFloat() * f + (1.0F - f) * 0.5F;
       float f2 = p_71914_1_.field_73012_v.nextFloat() * f + (1.0F - f) * 0.5F;
       float f3 = p_71914_1_.field_73012_v.nextFloat() * f + (1.0F - f) * 0.5F;
       EntityItem entityitem =
           new EntityItem(
               p_71914_1_,
               (float) p_71914_2_ + f1,
               (float) p_71914_3_ + f2,
               (float) p_71914_4_ + f3,
               new ItemStack(Item.field_77690_S));
       entityitem.field_70293_c = 10;
       p_71914_1_.func_72838_d(entityitem);
     }
   }
 }
Ejemplo n.º 2
0
  public void func_71914_a(
      World p_71914_1_,
      int p_71914_2_,
      int p_71914_3_,
      int p_71914_4_,
      int p_71914_5_,
      float p_71914_6_,
      int p_71914_7_) {
    super.func_71914_a(
        p_71914_1_, p_71914_2_, p_71914_3_, p_71914_4_, p_71914_5_, p_71914_6_, p_71914_7_);
    if (!p_71914_1_.field_72995_K) {
      Item var8 = null;
      if (this.field_72267_a == Block.field_72061_ba) {
        var8 = Item.field_77739_bg;
      }

      if (this.field_72267_a == Block.field_71997_br) {
        var8 = Item.field_77740_bh;
      }

      for (int var9 = 0; var9 < 3; ++var9) {
        if (p_71914_1_.field_73012_v.nextInt(15) <= p_71914_5_) {
          this.func_71929_a(p_71914_1_, p_71914_2_, p_71914_3_, p_71914_4_, new ItemStack(var8));
        }
      }
    }
  }
Ejemplo n.º 3
0
  public void func_71914_a(
      World p_71914_1_,
      int p_71914_2_,
      int p_71914_3_,
      int p_71914_4_,
      int p_71914_5_,
      float p_71914_6_,
      int p_71914_7_) {
    super.func_71914_a(p_71914_1_, p_71914_2_, p_71914_3_, p_71914_4_, p_71914_5_, p_71914_6_, 0);
    if (!p_71914_1_.field_72995_K) {
      if (p_71914_5_ >= 7) {
        int var8 = 3 + p_71914_7_;

        for (int var9 = 0; var9 < var8; ++var9) {
          if (p_71914_1_.field_73012_v.nextInt(15) <= p_71914_5_) {
            this.func_71929_a(
                p_71914_1_,
                p_71914_2_,
                p_71914_3_,
                p_71914_4_,
                new ItemStack(this.func_82532_h(), 1, 0));
          }
        }
      }
    }
  }
Ejemplo n.º 4
0
  /** Ticks the block if it's been scheduled */
  public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
    int var6 = par1World.getBlockMetadata(par2, par3, par4);

    if (var6 < 3 && par5Random.nextInt(10) == 0) {
      ++var6;
      par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2);
    }

    super.updateTick(par1World, par2, par3, par4, par5Random);
  }
Ejemplo n.º 5
0
 /*
  * ここで成長処理判定
  * world.getBlockLightValueが光度判定
  * 9以上なら成長するよという記述 最大15(太陽が一番照っているとき)
  */
 public void updateTick(World world, int i, int j, int k, Random random) {
   super.updateTick(world, i, j, k, random);
   if (world.getBlockLightValue(i, j + 1, k) >= 9) {
     int l = world.getBlockMetadata(i, j, k);
     if (l < 7) {
       float f = getGrowthRate(world, i, j, k);
       if (random.nextInt((int) (25F / f) + 1) == 0) {
         l++;
         world.setBlockMetadataWithNotify(i, j, k, l);
       }
     }
   }
 }
Ejemplo n.º 6
0
 public void func_208_a(World world, int i, int j, int k, Random random) {
   if (world.field_1026_y) {
     return;
   }
   super.func_208_a(world, i, j, k, random);
   if (world.func_618_j(i, j + 1, k) >= 9 && random.nextInt(7) == 0) {
     int l = world.func_602_e(i, j, k);
     if ((l & 8) == 0) {
       world.func_691_b(i, j, k, l | 8);
     } else {
       func_21028_c(world, i, j, k, random);
     }
   }
 }
Ejemplo n.º 7
0
 public void func_71847_b(
     World p_71847_1_, int p_71847_2_, int p_71847_3_, int p_71847_4_, Random p_71847_5_) {
   super.func_71847_b(p_71847_1_, p_71847_2_, p_71847_3_, p_71847_4_, p_71847_5_);
   if (p_71847_1_.func_72957_l(p_71847_2_, p_71847_3_ + 1, p_71847_4_) >= 9) {
     int var6 = p_71847_1_.func_72805_g(p_71847_2_, p_71847_3_, p_71847_4_);
     if (var6 < 7) {
       float var7 = this.func_72273_l(p_71847_1_, p_71847_2_, p_71847_3_, p_71847_4_);
       if (p_71847_5_.nextInt((int) (25.0F / var7) + 1) == 0) {
         ++var6;
         p_71847_1_.func_72921_c(p_71847_2_, p_71847_3_, p_71847_4_, var6, 2);
       }
     }
   }
 }
Ejemplo n.º 8
0
 public void func_71847_b(
     World p_71847_1_, int p_71847_2_, int p_71847_3_, int p_71847_4_, Random p_71847_5_) {
   super.func_71847_b(p_71847_1_, p_71847_2_, p_71847_3_, p_71847_4_, p_71847_5_);
   if (p_71847_1_.func_72957_l(p_71847_2_, p_71847_3_ + 1, p_71847_4_) >= 9) {
     int i = p_71847_1_.func_72805_g(p_71847_2_, p_71847_3_, p_71847_4_);
     if (i < 7) {
       float f = func_72273_l(p_71847_1_, p_71847_2_, p_71847_3_, p_71847_4_);
       if (p_71847_5_.nextInt((int) (25F / f) + 1) == 0) {
         i++;
         p_71847_1_.func_72921_c(p_71847_2_, p_71847_3_, p_71847_4_, i);
       }
     }
   }
 }
Ejemplo n.º 9
0
 public void func_71847_b(
     World p_71847_1_, int p_71847_2_, int p_71847_3_, int p_71847_4_, Random p_71847_5_) {
   if (!p_71847_1_.field_72995_K) {
     super.func_71847_b(p_71847_1_, p_71847_2_, p_71847_3_, p_71847_4_, p_71847_5_);
     if (p_71847_1_.func_72957_l(p_71847_2_, p_71847_3_ + 1, p_71847_4_) >= 9
         && p_71847_5_.nextInt(7) == 0) {
       int var6 = p_71847_1_.func_72805_g(p_71847_2_, p_71847_3_, p_71847_4_);
       if ((var6 & 8) == 0) {
         p_71847_1_.func_72921_c(p_71847_2_, p_71847_3_, p_71847_4_, var6 | 8);
       } else {
         this.func_72269_c(p_71847_1_, p_71847_2_, p_71847_3_, p_71847_4_, p_71847_5_);
       }
     }
   }
 }
Ejemplo n.º 10
0
  /** Ticks the block if it's been scheduled */
  public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
    super.updateTick(par1World, par2, par3, par4, par5Random);

    if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) {
      int var6 = par1World.getBlockMetadata(par2, par3, par4);

      if (var6 < 7) {
        float var7 = this.getGrowthRate(par1World, par2, par3, par4);

        if (par5Random.nextInt((int) (25.0F / var7) + 1) == 0) {
          ++var6;
          par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2);
        }
      }
    }
  }
Ejemplo n.º 11
0
  /** Drops the block items with a specified chance of dropping the specified items */
  public void dropBlockAsItemWithChance(
      World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
    super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);

    if (!par1World.isRemote) {
      if (par5 >= 7) {
        int var8 = 3 + par7;

        for (int var9 = 0; var9 < var8; ++var9) {
          if (par1World.rand.nextInt(15) <= par5) {
            this.dropBlockAsItem_do(
                par1World, par2, par3, par4, new ItemStack(this.getSeedItem(), 1, 0));
          }
        }
      }
    }
  }
Ejemplo n.º 12
0
  /** Drops the block items with a specified chance of dropping the specified items */
  public void dropBlockAsItemWithChance(
      World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {
    super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);

    if (par1World.isRemote) {
      return;
    }

    Item item = null;

    if (fruitType == Block.pumpkin) {
      item = Item.pumpkinSeeds;
    }

    if (fruitType == Block.melon) {
      item = Item.melonSeeds;
    }

    for (int i = 0; i < 3; i++) {
      if (par1World.rand.nextInt(15) <= par5) {
        float f = 0.7F;
        float f1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
        float f2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
        float f3 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
        EntityItem entityitem =
            new EntityItem(
                par1World,
                (float) par2 + f1,
                (float) par3 + f2,
                (float) par4 + f3,
                new ItemStack(item));
        entityitem.delayBeforeCanPickup = 10;
        par1World.spawnEntityInWorld(entityitem);
      }
    }
  }
Ejemplo n.º 13
0
  public void func_71847_b(
      World p_71847_1_, int p_71847_2_, int p_71847_3_, int p_71847_4_, Random p_71847_5_) {
    super.func_71847_b(p_71847_1_, p_71847_2_, p_71847_3_, p_71847_4_, p_71847_5_);
    if (p_71847_1_.func_72957_l(p_71847_2_, p_71847_3_ + 1, p_71847_4_) >= 9) {
      float var6 = this.func_72266_n(p_71847_1_, p_71847_2_, p_71847_3_, p_71847_4_);
      if (p_71847_5_.nextInt((int) (25.0F / var6) + 1) == 0) {
        int var7 = p_71847_1_.func_72805_g(p_71847_2_, p_71847_3_, p_71847_4_);
        if (var7 < 7) {
          ++var7;
          p_71847_1_.func_72921_c(p_71847_2_, p_71847_3_, p_71847_4_, var7);
        } else {
          if (p_71847_1_.func_72798_a(p_71847_2_ - 1, p_71847_3_, p_71847_4_)
              == this.field_72267_a.field_71990_ca) {
            return;
          }

          if (p_71847_1_.func_72798_a(p_71847_2_ + 1, p_71847_3_, p_71847_4_)
              == this.field_72267_a.field_71990_ca) {
            return;
          }

          if (p_71847_1_.func_72798_a(p_71847_2_, p_71847_3_, p_71847_4_ - 1)
              == this.field_72267_a.field_71990_ca) {
            return;
          }

          if (p_71847_1_.func_72798_a(p_71847_2_, p_71847_3_, p_71847_4_ + 1)
              == this.field_72267_a.field_71990_ca) {
            return;
          }

          int var8 = p_71847_5_.nextInt(4);
          int var9 = p_71847_2_;
          int var10 = p_71847_4_;
          if (var8 == 0) {
            var9 = p_71847_2_ - 1;
          }

          if (var8 == 1) {
            ++var9;
          }

          if (var8 == 2) {
            var10 = p_71847_4_ - 1;
          }

          if (var8 == 3) {
            ++var10;
          }

          int var11 = p_71847_1_.func_72798_a(var9, p_71847_3_ - 1, var10);
          if (p_71847_1_.func_72798_a(var9, p_71847_3_, var10) == 0
              && (var11 == Block.field_72050_aA.field_71990_ca
                  || var11 == Block.field_71979_v.field_71990_ca
                  || var11 == Block.field_71980_u.field_71990_ca)) {
            p_71847_1_.func_72859_e(var9, p_71847_3_, var10, this.field_72267_a.field_71990_ca);
          }
        }
      }
    }
  }
Ejemplo n.º 14
0
  /** Ticks the block if it's been scheduled */
  public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
    super.updateTick(par1World, par2, par3, par4, par5Random);

    if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) {
      float f = getGrowthModifier(par1World, par2, par3, par4);

      if (par5Random.nextInt((int) (25F / f) + 1) == 0) {
        int i = par1World.getBlockMetadata(par2, par3, par4);

        if (i < 7) {
          i++;
          par1World.setBlockMetadataWithNotify(par2, par3, par4, i);
        } else {
          if (par1World.getBlockId(par2 - 1, par3, par4) == fruitType.blockID) {
            return;
          }

          if (par1World.getBlockId(par2 + 1, par3, par4) == fruitType.blockID) {
            return;
          }

          if (par1World.getBlockId(par2, par3, par4 - 1) == fruitType.blockID) {
            return;
          }

          if (par1World.getBlockId(par2, par3, par4 + 1) == fruitType.blockID) {
            return;
          }

          int j = par5Random.nextInt(4);
          int k = par2;
          int l = par4;

          if (j == 0) {
            k--;
          }

          if (j == 1) {
            k++;
          }

          if (j == 2) {
            l--;
          }

          if (j == 3) {
            l++;
          }

          int i1 = par1World.getBlockId(k, par3 - 1, l);

          if (par1World.getBlockId(k, par3, l) == 0
              && (i1 == Block.tilledField.blockID
                  || i1 == Block.dirt.blockID
                  || i1 == Block.grass.blockID)) {
            par1World.setBlockWithNotify(k, par3, l, fruitType.blockID);
          }
        }
      }
    }
  }