@Override public void customExplosion(World world, Explosion explosion) { net.minecraftforge.event.ForgeEventFactory.onExplosionStart(world, explosion); explosion.doExplosionA(); explosion.doExplosionB(true); }
public void customExplosion(World world, Explosion explosion) { // server side if(net.minecraftforge.event.ForgeEventFactory.onExplosionStart(world, explosion)) { return; } explosion.doExplosionA(); explosion.doExplosionB(false); if(!explosion.damagesTerrain) { explosion.clearAffectedBlockPositions(); } // todo: send custom explosion packet to clients // Send packets so player are moved around /* for (EntityPlayer entityplayer : world.playerEntities) { //if (entityplayer.getDistanceSq(x, y, z) < 4096.0D) { Vec3d vec = explosion.getPosition(); ((EntityPlayerMP)entityplayer).playerNetServerHandler.sendPacket(new SPacketExplosion(vec.xCoord, vec.yCoord, vec.zCoord, 1, explosion.getAffectedBlockPositions(), (Vec3d)explosion.getPlayerKnockbackMap().get(entityplayer))); } }*/ }
protected void explode(float strength) { if(!getEntityWorld().isRemote) { ExplosionEFLN explosion = new ExplosionEFLN(getEntityWorld(), this, posX, posY, posZ, strength, false, false); if(!ForgeEventFactory.onExplosionStart(world, explosion)) { Exploder.startExplosion(getEntityWorld(), explosion, this, new BlockPos(posX, posY, posZ), strength, strength); } } }
private boolean manageExplosions(RayTraceResult hit) { if (explodeMultiply > 0) { if (!world.isRemote) { Explosion explosion = new Explosion(world, this, hit.hitVec.x, hit.hitVec.y, hit.hitVec.z, explodeMultiply, false, false); if (!net.minecraftforge.event.ForgeEventFactory.onExplosionStart(world, explosion)) { explosion.doExplosionA(); this.world.playSound(null, hit.hitVec.x, hit.hitVec.y, hit.hitVec.z, MatterOverdriveSounds.weaponsExplosiveShot, SoundCategory.PLAYERS, 3.0F, (1.0F + (this.world.rand.nextFloat() - this.world.rand.nextFloat()) * 0.2F) * 0.7F); } } else { manageClientExplosions(hit); } return true; } return false; }
public NewExp newBoom(World worldIn, Entity entityIn, double x, double y, double z, float size, float power, float damage, float blast, boolean isFlaming, boolean isSmoking) { NewExp explosion = new NewExp(worldIn, null, x, y, z, size, power, damage, blast, isFlaming, isSmoking); if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(worldIn, explosion)) return explosion; //Not this explosion.doExplosionA(); //CallRunner.onExplosionA(explosion); explosion.doExplosionB(true); return explosion; }
public NewExp2 newBoom(World worldIn, Entity entityIn, double x, double y, double z, float size, float power, float damage, float blast, boolean isFlaming, boolean isSmoking) { NewExp2 explosion = new NewExp2(worldIn, null, x, y, z, size, power, damage, blast, isFlaming, isSmoking); if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(worldIn, explosion)) return explosion; //Not this explosion.doExplosionA(); //CallRunner.onExplosionA(explosion); explosion.doExplosionB(true); return explosion; }