Exemplo n.º 1
0
  public void b(World var1, BlockPosition var2, IBlockData var3, Random var4) {
    super.b(var1, var2, var3, var4);
    if (var1.worldProvider.d()
        && var1.getGameRules().getBoolean("doMobSpawning")
        && var4.nextInt(2000) < var1.getDifficulty().a()) {
      int var5 = var2.getY();

      BlockPosition var6;
      for (var6 = var2;
          !World.a((IBlockAccess) var1, (BlockPosition) var6) && var6.getY() > 0;
          var6 = var6.down()) {;
      }

      if (var5 > 0 && !var1.getType(var6.up()).getBlock().isOccluding()) {
        Entity var7 =
            ItemMonsterEgg.a(
                var1,
                57,
                (double) var6.getX() + 0.5D,
                (double) var6.getY() + 1.1D,
                (double) var6.getZ() + 0.5D);
        if (var7 != null) {
          var7.portalCooldown = var7.aq();
        }
      }
    }
  }
Exemplo n.º 2
0
  public void a(World world, int i, int j, int k, Random random) {
    super.a(world, i, j, k, random);
    if (world.worldProvider.d() && random.nextInt(2000) < world.difficulty) {
      int l;

      for (l = j; !world.w(i, l, k) && l > 0; --l) {;
      }

      if (l > 0 && !world.u(i, l + 1, k)) {
        Entity entity =
            ItemMonsterEgg.a(world, 57, (double) i + 0.5D, (double) l + 1.1D, (double) k + 0.5D);

        if (entity != null) {
          entity.portalCooldown = entity.aa();
        }
      }
    }
  }