public void handleExplosion(Packet60Explosion var1) {
   Explosion var2 =
       new Explosion(
           this.mc.theWorld,
           (Entity) null,
           var1.explosionX,
           var1.explosionY,
           var1.explosionZ,
           var1.explosionSize);
   var2.destroyedBlockPositions = var1.destroyedBlockPositions;
   var2.doExplosionB(true);
 }
Example #2
0
 /** Called upon the block being destroyed by an explosion */
 public void onBlockDestroyedByExplosion(
     World par1World, int par2, int par3, int par4, Explosion par5Explosion) {
   if (!par1World.isRemote) {
     EntityTNTPrimed var6 =
         new EntityTNTPrimed(
             par1World,
             (double) ((float) par2 + 0.5F),
             (double) ((float) par3 + 0.5F),
             (double) ((float) par4 + 0.5F),
             par5Explosion.func_94613_c());
     var6.fuse = par1World.rand.nextInt(var6.fuse / 4) + var6.fuse / 8;
     par1World.spawnEntityInWorld(var6);
   }
 }
Example #3
0
  /** returns a new explosion. Does initiation (at time of writing Explosion is not finished) */
  public Explosion newExplosion(
      Entity par1Entity,
      double par2,
      double par4,
      double par6,
      float par8,
      boolean par9,
      boolean par10) {
    Explosion var11 = new Explosion(this, par1Entity, par2, par4, par6, par8);
    var11.isFlaming = par9;
    var11.isSmoking = par10;
    var11.doExplosionA();
    var11.doExplosionB(false);

    if (!par10) {
      var11.affectedBlockPositions.clear();
    }

    Iterator var12 = this.playerEntities.iterator();

    while (var12.hasNext()) {
      EntityPlayer var13 = (EntityPlayer) var12.next();

      if (var13.getDistanceSq(par2, par4, par6) < 4096.0D) {
        ((EntityPlayerMP) var13)
            .playerNetServerHandler.sendPacketToPlayer(
                new Packet60Explosion(
                    par2,
                    par4,
                    par6,
                    par8,
                    var11.affectedBlockPositions,
                    (Vec3) var11.func_77277_b().get(var13)));
      }
    }

    return var11;
  }