public void b(World var1, BlockPosition var2, IBlockData var3, Random var4) {
    if (this.material == Material.LAVA) {
      if (var1.getGameRules().getBoolean("doFireTick")) {
        int var5 = var4.nextInt(3);
        if (var5 > 0) {
          BlockPosition var6 = var2;

          for (int var7 = 0; var7 < var5; ++var7) {
            var6 = var6.a(var4.nextInt(3) - 1, 1, var4.nextInt(3) - 1);
            Block var8 = var1.getType(var6).getBlock();
            if (var8.material == Material.AIR) {
              if (this.f(var1, var6)) {
                var1.setTypeUpdate(var6, Blocks.FIRE.getBlockData());
                return;
              }
            } else if (var8.material.isSolid()) {
              return;
            }
          }
        } else {
          for (int var9 = 0; var9 < 3; ++var9) {
            BlockPosition var10 = var2.a(var4.nextInt(3) - 1, 0, var4.nextInt(3) - 1);
            if (var1.isEmpty(var10.up()) && this.m(var1, var10)) {
              var1.setTypeUpdate(var10.up(), Blocks.FIRE.getBlockData());
            }
          }
        }
      }
    }
  }
Beispiel #2
0
  protected static float a(Block var0, World var1, BlockPosition var2) {
    float var3 = 1.0F;
    BlockPosition var4 = var2.down();

    for (int var5 = -1; var5 <= 1; ++var5) {
      for (int var6 = -1; var6 <= 1; ++var6) {
        float var7 = 0.0F;
        IBlockData var8 = var1.getType(var4.a(var5, 0, var6));
        if (var8.getBlock() == Blocks.FARMLAND) {
          var7 = 1.0F;
          if (((Integer) var8.get(BlockSoil.MOISTURE)).intValue() > 0) {
            var7 = 3.0F;
          }
        }

        if (var5 != 0 || var6 != 0) {
          var7 /= 4.0F;
        }

        var3 += var7;
      }
    }

    BlockPosition var12 = var2.north();
    BlockPosition var13 = var2.south();
    BlockPosition var15 = var2.west();
    BlockPosition var14 = var2.east();
    boolean var9 = var0 == var1.getType(var15).getBlock() || var0 == var1.getType(var14).getBlock();
    boolean var10 =
        var0 == var1.getType(var12).getBlock() || var0 == var1.getType(var13).getBlock();
    if (var9 && var10) {
      var3 /= 2.0F;
    } else {
      boolean var11 =
          var0 == var1.getType(var15.north()).getBlock()
              || var0 == var1.getType(var14.north()).getBlock()
              || var0 == var1.getType(var14.south()).getBlock()
              || var0 == var1.getType(var15.south()).getBlock();
      if (var11) {
        var3 /= 2.0F;
      }
    }

    return var3;
  }