Search in sources :

Example 1 with PacketExtendedExplosion

use of convenientadditions.api.network.PacketExtendedExplosion in project ConvenientAdditions by Necr0.

the class ExtendedExplosion method newExplosion.

public static Explosion newExplosion(ExtendedExplosion e) {
    if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(e.getWorld(), e))
        return e;
    e.doExplosionA();
    e.doExplosionB(false);
    if (!e.isSmoking) {
        e.clearAffectedBlockPositions();
    }
    for (EntityPlayer entityplayer : e.getWorld().playerEntities) {
        if (entityplayer instanceof EntityPlayerMP && entityplayer.getDistanceSq(e.explosionX, e.explosionY, e.explosionZ) < 4096.0D) {
            ModNetworking.INSTANCE.sendTo(new PacketExtendedExplosion(e.explosionX, e.explosionY, e.explosionZ, e.explosionSize, e.getAffectedBlockPositions(), (Vec3d) e.getPlayerKnockbackMap().get(entityplayer)), (EntityPlayerMP) entityplayer);
        }
    }
    return e;
}
Also used : PacketExtendedExplosion(convenientadditions.api.network.PacketExtendedExplosion) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) Vec3d(net.minecraft.util.math.Vec3d)

Aggregations

PacketExtendedExplosion (convenientadditions.api.network.PacketExtendedExplosion)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 Vec3d (net.minecraft.util.math.Vec3d)1