@Override public byte[] generatePacket(Object... data) { ByteArrayDataOutput dat = ByteStreams.newDataOutput(); Set<ModContainer> activeMods = FMLNetworkHandler.instance().getNetworkModList(); dat.writeInt(activeMods.size()); for (ModContainer mc : activeMods) { dat.writeUTF(mc.getModId()); } dat.writeByte(FMLNetworkHandler.getCompatibilityLevel()); return dat.toByteArray(); }
public final Packet makePacket() { ByteArrayDataOutput out = ByteStreams.newDataOutput(); out.writeByte(getPacketId()); write(out); return PacketDispatcher.getPacket(CHANNEL, out.toByteArray()); }
@Override public void write(Object o, ByteArrayDataOutput dat) { dat.writeByte((Byte) o); }