Search in sources :

Example 6 with RailcraftOutputStream

use of mods.railcraft.common.util.network.RailcraftOutputStream 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

RailcraftOutputStream (mods.railcraft.common.util.network.RailcraftOutputStream)6 IOException (java.io.IOException)5 PacketEffect (mods.railcraft.common.util.network.PacketEffect)4 ByteBuf (io.netty.buffer.ByteBuf)1 ByteBufOutputStream (io.netty.buffer.ByteBufOutputStream)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1