Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "XPdec";
packet.data = bos.toByteArray();
packet.length = bos.size();
Side side = FMLCommonHandler.instance().getEffectiveSide();
if (side == Side.SERVER) {
// We are on the server side.
EntityPlayerMP player = (EntityPlayerMP) playerEntity;
} else if (side == Side.CLIENT) {
// We are on the client side.