Java 类net.minecraft.network.play.server.SPacketExplosion 实例源码

项目:Backmemed    文件:WorldServer.java   
/**
 * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
 */
public Explosion newExplosion(@Nullable 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.clearAffectedBlockPositions();
    }

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.getDistanceSq(x, y, z) < 4096.0D)
        {
            ((EntityPlayerMP)entityplayer).connection.sendPacket(new SPacketExplosion(x, y, z, strength, explosion.getAffectedBlockPositions(), (Vec3d)explosion.getPlayerKnockbackMap().get(entityplayer)));
        }
    }

    return explosion;
}
项目:CustomWorldGen    文件:WorldServer.java   
/**
 * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
 */
public Explosion newExplosion(@Nullable 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);
    if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion;
    explosion.doExplosionA();
    explosion.doExplosionB(false);

    if (!isSmoking)
    {
        explosion.clearAffectedBlockPositions();
    }

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.getDistanceSq(x, y, z) < 4096.0D)
        {
            ((EntityPlayerMP)entityplayer).connection.sendPacket(new SPacketExplosion(x, y, z, strength, explosion.getAffectedBlockPositions(), (Vec3d)explosion.getPlayerKnockbackMap().get(entityplayer)));
        }
    }

    return explosion;
}
项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
public void handleExplosion(SPacketExplosion packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Explosion explosion = new Explosion(this.gameController.world, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions());
    explosion.doExplosionB(true);
    this.gameController.player.motionX += (double)packetIn.getMotionX();
    this.gameController.player.motionY += (double)packetIn.getMotionY();
    this.gameController.player.motionZ += (double)packetIn.getMotionZ();
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
public void handleExplosion(SPacketExplosion packetIn)
{
     if(Hacks.findMod(AntiVelocity.class).isEnabled())
    return;

    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Explosion explosion = new Explosion(this.gameController.world, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions());
    explosion.doExplosionB(true);
    this.gameController.player.motionX += (double)packetIn.getMotionX();
    this.gameController.player.motionY += (double)packetIn.getMotionY();
    this.gameController.player.motionZ += (double)packetIn.getMotionZ();
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
public void handleExplosion(SPacketExplosion 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.getMotionX();
    this.gameController.thePlayer.motionY += (double)packetIn.getMotionY();
    this.gameController.thePlayer.motionZ += (double)packetIn.getMotionZ();
}
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
public void handleExplosion(SPacketExplosion 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.getMotionX();
    this.gameController.thePlayer.motionY += (double)packetIn.getMotionY();
    this.gameController.thePlayer.motionZ += (double)packetIn.getMotionZ();
}
项目:AbyssalCraft    文件:ExplosionUtil.java   
public static Explosion newODBExplosion(World world, Entity entity, double x, double y, double z, float strength, boolean antimatter, boolean smoke)
{
    ACExplosion explosion = new ACExplosion(world, entity, x, y, z, strength, antimatter, smoke);
    if(net.minecraftforge.event.ForgeEventFactory.onExplosionStart(world, explosion)) return explosion;
    explosion.doExplosionA();
    explosion.doExplosionB(strength <= 32);

    if(world instanceof WorldServer)
        for (EntityPlayer entityplayer : ((WorldServer)world).playerEntities)
            if (entityplayer.getDistanceSq(x, y, z) < 4096.0D)
                ((EntityPlayerMP)entityplayer).connection.sendPacket(new SPacketExplosion(x, y, z , strength, explosion.getAffectedBlockPositions(), explosion.getPlayerKnockbackMap().get(entityplayer)));

    return explosion;
}
项目:Backmemed    文件:INetHandlerPlayClient.java   
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
void handleExplosion(SPacketExplosion packetIn);
项目:CustomWorldGen    文件:INetHandlerPlayClient.java   
/**
 * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
 */
void handleExplosion(SPacketExplosion packetIn);