Search in sources :

Example 1 with PacketEffect

use of mods.railcraft.common.util.network.PacketEffect in project Railcraft by Railcraft.

the class CommonEffectProxy method fireSparkEffect.

@Override
public void fireSparkEffect(World world, Vec3d start, Vec3d end) {
    if (Game.isClient(world))
        return;
    try {
        PacketEffect pkt = new PacketEffect(Effect.FIRESPARK);
        RailcraftOutputStream data = pkt.getOutputStream();
        data.writeVec3d(start);
        data.writeVec3d(end);
        pkt.sendPacket(world, start);
    } catch (IOException ignored) {
    }
}
Also used : RailcraftOutputStream(mods.railcraft.common.util.network.RailcraftOutputStream) PacketEffect(mods.railcraft.common.util.network.PacketEffect) IOException(java.io.IOException)

Example 2 with PacketEffect

use of mods.railcraft.common.util.network.PacketEffect in project Railcraft by Railcraft.

the class CommonEffectProxy method teleportEffect.

@Override
public void teleportEffect(Entity entity, Vec3d destination) {
    if (Game.isClient(entity.worldObj))
        return;
    try {
        PacketEffect pkt = new PacketEffect(Effect.TELEPORT);
        RailcraftOutputStream data = pkt.getOutputStream();
        data.writeVec3d(entity.getPositionVector());
        data.writeVec3d(destination);
        pkt.sendPacket(entity.worldObj, entity.getPositionVector());
    } catch (IOException ignored) {
    }
    SoundHelper.playSoundAtEntity(entity, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.BLOCKS, 0.25F, 1.0F);
}
Also used : RailcraftOutputStream(mods.railcraft.common.util.network.RailcraftOutputStream) PacketEffect(mods.railcraft.common.util.network.PacketEffect) IOException(java.io.IOException)

Example 3 with PacketEffect

use of mods.railcraft.common.util.network.PacketEffect in project Railcraft by Railcraft.

the class CommonEffectProxy method zapEffectDeath.

@Override
public void zapEffectDeath(World world, Object source) {
    if (Game.isClient(world))
        return;
    try {
        PacketEffect pkt = new PacketEffect(Effect.ZAP_DEATH);
        RailcraftOutputStream data = pkt.getOutputStream();
        EffectManager.IEffectSource es = EffectManager.getEffectSource(source);
        data.writeVec3d(es.getPosF());
        pkt.sendPacket(world, es.getPosF());
    } catch (IOException ignored) {
    }
}
Also used : RailcraftOutputStream(mods.railcraft.common.util.network.RailcraftOutputStream) PacketEffect(mods.railcraft.common.util.network.PacketEffect) IOException(java.io.IOException)

Example 4 with PacketEffect

use of mods.railcraft.common.util.network.PacketEffect in project Railcraft by Railcraft.

the class CommonEffectProxy method forceTrackSpawnEffect.

@Override
public void forceTrackSpawnEffect(World world, BlockPos pos) {
    if (Game.isClient(world))
        return;
    try {
        PacketEffect pkt = new PacketEffect(Effect.FORCE_SPAWN);
        RailcraftOutputStream data = pkt.getOutputStream();
        data.writeBlockPos(pos);
        pkt.sendPacket(world, pos);
    } catch (IOException ignored) {
    }
    SoundHelper.playSound(world, null, pos, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.BLOCKS, 0.25F, 1.0F);
}
Also used : RailcraftOutputStream(mods.railcraft.common.util.network.RailcraftOutputStream) PacketEffect(mods.railcraft.common.util.network.PacketEffect) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)4 PacketEffect (mods.railcraft.common.util.network.PacketEffect)4 RailcraftOutputStream (mods.railcraft.common.util.network.RailcraftOutputStream)4