Esempio n. 1
0
  @Override
  public void wasExploded(World world, int i, int j, int k, Explosion explosion) {
    if (!world.isStatic) {
      EntityTNTPrimed entitytntprimed =
          new EntityTNTPrimed(world, i + 0.5F, j + 0.5F, k + 0.5F, explosion.c());

      entitytntprimed.fuseTicks =
          world.random.nextInt(entitytntprimed.fuseTicks / 4) + entitytntprimed.fuseTicks / 8;
      world.addEntity(entitytntprimed);
    }
  }
Esempio n. 2
0
  public Explosion createExplosion(
      Entity entity, double d0, double d1, double d2, float f, boolean flag, boolean flag1) {
    // CraftBukkit start
    Explosion explosion = super.createExplosion(entity, d0, d1, d2, f, flag, flag1);

    if (explosion.wasCanceled) {
      return explosion;
    }

    /* Remove
    explosion.a = flag;
    explosion.b = flag1;
    explosion.a();
    explosion.a(false);
    */
    // CraftBukkit end - TODO: Check if explosions are still properly implemented

    if (!flag1) {
      explosion.blocks.clear();
    }

    Iterator iterator = this.players.iterator();

    while (iterator.hasNext()) {
      EntityHuman entityhuman = (EntityHuman) iterator.next();

      if (entityhuman.e(d0, d1, d2) < 4096.0D) {
        ((EntityPlayer) entityhuman)
            .playerConnection.sendPacket(
                new Packet60Explosion(
                    d0, d1, d2, f, explosion.blocks, (Vec3D) explosion.b().get(entityhuman)));
      }
    }

    return explosion;
  }