/** * returns a new explosion. Does initiation (at time of writing Explosion is not finished) */ public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) { Explosion explosion = new Explosion(this, entityIn, x, y, z, strength, isFlaming, isSmoking); explosion.doExplosionA(); explosion.doExplosionB(false); if (!isSmoking) { explosion.func_180342_d(); } for (EntityPlayer entityplayer : this.playerEntities) { if (entityplayer.getDistanceSq(x, y, z) < 4096.0D) { ((EntityPlayerMP)entityplayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(x, y, z, strength, explosion.getAffectedBlockPositions(), (Vec3)explosion.getPlayerKnockbackMap().get(entityplayer))); } } return explosion; }
/** * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. */ public void handleExplosion(S27PacketExplosion packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Explosion explosion = new Explosion(this.gameController.theWorld, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions()); explosion.doExplosionB(true); this.gameController.thePlayer.motionX += (double)packetIn.func_149149_c(); this.gameController.thePlayer.motionY += (double)packetIn.func_149144_d(); this.gameController.thePlayer.motionZ += (double)packetIn.func_149147_e(); }
/** * Initiates a new explosion (sound, particles, drop spawn) for the affected * blocks indicated by the packet. */ public void handleExplosion(S27PacketExplosion packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Explosion explosion = new Explosion(this.gameController.theWorld, (Entity) null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions()); explosion.doExplosionB(true); this.gameController.thePlayer.motionX += (double) packetIn.func_149149_c(); this.gameController.thePlayer.motionY += (double) packetIn.func_149144_d(); this.gameController.thePlayer.motionZ += (double) packetIn.func_149147_e(); }
/** * returns a new explosion. Does initiation (at time of writing Explosion is * not finished) */ public Explosion newExplosion(Entity p_72885_1_, double x, double y, double z, float p_72885_8_, boolean isFlaming, boolean isSmoking) { Explosion explosion = new Explosion(this, p_72885_1_, x, y, z, p_72885_8_); explosion.isFlaming = isFlaming; explosion.isSmoking = isSmoking; if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; explosion.doExplosionA(); explosion.doExplosionB(false); if (!isSmoking) { explosion.affectedBlockPositions.clear(); } Iterator<?> iterator = this.playerEntities.iterator(); while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer) iterator.next(); if (entityplayer.getDistanceSq(x, y, z) < 4096.0D) { ((EntityPlayerMP) entityplayer).playerNetServerHandler .sendPacket(new S27PacketExplosion(x, y, z, p_72885_8_, explosion.affectedBlockPositions, (Vec3) explosion.func_77277_b().get(entityplayer))); } } return explosion; }
public static M4thCustomExplosion newExplosion(World world, Entity entity, double x, double y, double z, float size, boolean par9, boolean destroyBlocks,int explosionSoundChoice) { M4thCustomExplosion explosion = new M4thCustomExplosion(world,entity,x,y,z,size); explosion.setExplosionSound(explosionSoundChoice); explosion.isFlaming = par9; explosion.isSmoking = destroyBlocks; if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(world,explosion)) { return explosion; } explosion.doExplosionA(); explosion.doExplosionB(true); //new if (!destroyBlocks) { explosion.affectedBlockPositions.clear(); } Iterator iterator = world.playerEntities.iterator(); while (iterator.hasNext()) { EntityPlayer entityPlayer = (EntityPlayer)iterator.next(); if (entityPlayer.getDistanceSq(x,y,z) < 4096.0D) { ((EntityPlayerMP)entityPlayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(x,y,z,size,explosion.affectedBlockPositions,(Vec3)explosion.func_77277_b().get(entityPlayer))); } } //end new return explosion; }
/** * 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.sendPacket(new S27PacketExplosion(par2, par4, par6, par8, var11.affectedBlockPositions, (Vec3)var11.func_77277_b().get(var13))); } } return var11; }
/** * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. */ public void handleExplosion(S27PacketExplosion p_147283_1_) { Explosion var2 = new Explosion(this.gameController.theWorld, (Entity)null, p_147283_1_.func_149148_f(), p_147283_1_.func_149143_g(), p_147283_1_.func_149145_h(), p_147283_1_.func_149146_i()); var2.affectedBlockPositions = p_147283_1_.func_149150_j(); var2.doExplosionB(true); this.gameController.thePlayer.motionX += (double)p_147283_1_.func_149149_c(); this.gameController.thePlayer.motionY += (double)p_147283_1_.func_149144_d(); this.gameController.thePlayer.motionZ += (double)p_147283_1_.func_149147_e(); }
@SuppressWarnings("unchecked") public static void explodeBlock(World world, int x, int y, int z) { if (FMLCommonHandler.instance().getEffectiveSide().isClient()) return; float strength = 3F; Explosion explosion = new Explosion(world, null, x + .5, y + .5, z + .5, strength); Block block = world.getBlock(x, y, z); float res = block.getExplosionResistance(null); if(block.getBlockHardness(world, x,y,z) > -1) { explosion.affectedBlockPositions.add(new ChunkPosition(x, y, z)); } explosion.doExplosionB(true); for (EntityPlayer player : (List<EntityPlayer>) world.playerEntities) { if (!(player instanceof EntityPlayerMP)) continue; if (player.getDistanceSq(x, y, z) < 4096) { ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S27PacketExplosion(x + .5, y + .5, z + .5, 3f, explosion.affectedBlockPositions, null)); } } }
public static void explodeBlocks(World world, int x, int y, int z, ArrayList<ChunkPosition> pos) { if (FMLCommonHandler.instance().getEffectiveSide().isClient()) return; float strength = 3F; Explosion explosion = new Explosion(world, null, x + .5, y + .5, z + .5, strength); explosion.affectedBlockPositions.add(new ChunkPosition(x, y, z)); for(ChunkPosition po : pos){ Block block = world.getBlock(po.chunkPosX, po.chunkPosY, po.chunkPosZ); float res = block.getExplosionResistance(null); if(block.getBlockHardness(world, po.chunkPosX, po.chunkPosY, po.chunkPosZ) > -1) { explosion.affectedBlockPositions.add(po); } } explosion.doExplosionB(true); for (EntityPlayer player : (List<EntityPlayer>) world.playerEntities) { if (!(player instanceof EntityPlayerMP)) continue; if (player.getDistanceSq(x, y, z) < 4096) { ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S27PacketExplosion(x + .5, y + .5, z + .5, 3f, explosion.affectedBlockPositions, null)); } } }
public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) { // CraftBukkit start Explosion explosion = super.newExplosion(p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_); if (explosion.wasCanceled) { return explosion; } /* Remove Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); explosion.isFlaming = p_72885_9_; explosion.isSmoking = p_72885_10_; explosion.doExplosionA(); explosion.doExplosionB(false); */ // CraftBukkit end - TODO: Check if explosions are still properly implemented if (!p_72885_10_) { explosion.affectedBlockPositions.clear(); } Iterator iterator = this.playerEntities.iterator(); while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer)iterator.next(); if (entityplayer.getDistanceSq(p_72885_2_, p_72885_4_, p_72885_6_) < 4096.0D) { ((EntityPlayerMP)entityplayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, explosion.affectedBlockPositions, (Vec3)explosion.func_77277_b().get(entityplayer))); } } return explosion; }
public void handleExplosion(S27PacketExplosion p_147283_1_) { Explosion explosion = new Explosion(this.gameController.theWorld, (Entity)null, p_147283_1_.func_149148_f(), p_147283_1_.func_149143_g(), p_147283_1_.func_149145_h(), p_147283_1_.func_149146_i()); explosion.affectedBlockPositions = p_147283_1_.func_149150_j(); explosion.doExplosionB(true); this.gameController.thePlayer.motionX += (double)p_147283_1_.func_149149_c(); this.gameController.thePlayer.motionY += (double)p_147283_1_.func_149144_d(); this.gameController.thePlayer.motionZ += (double)p_147283_1_.func_149147_e(); }
public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) { Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); explosion.isFlaming = p_72885_9_; explosion.isSmoking = p_72885_10_; explosion.doExplosionA(); explosion.doExplosionB(false); if (!p_72885_10_) { explosion.affectedBlockPositions.clear(); } Iterator iterator = this.playerEntities.iterator(); while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer)iterator.next(); if (entityplayer.getDistanceSq(p_72885_2_, p_72885_4_, p_72885_6_) < 4096.0D) { ((EntityPlayerMP)entityplayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, explosion.affectedBlockPositions, (Vec3)explosion.func_77277_b().get(entityplayer))); } } return explosion; }
protected void notifyClients() { if (!worldObj.isRemote) { Iterator<EntityPlayer> iterator = worldObj.playerEntities.iterator(); while (iterator.hasNext()) { EntityPlayer player = iterator.next(); if (player.getDistanceSq(explosionX, explosionY, explosionZ) < 4096.0D) { ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S27PacketExplosion(explosionX, explosionY, explosionZ, explosionSize, affectedBlockPositions, (Vec3) this.getPlayerKnockbackMap().get(player))); } } } }
/** * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. */ void handleExplosion(S27PacketExplosion packetIn);
/** * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. */ void handleExplosion(S27PacketExplosion var1);
void handleExplosion(S27PacketExplosion p_147283_1_);