예제 #1
0
 @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();
 }
예제 #2
0
 public final Packet makePacket() {
   ByteArrayDataOutput out = ByteStreams.newDataOutput();
   out.writeByte(getPacketId());
   write(out);
   return PacketDispatcher.getPacket(CHANNEL, out.toByteArray());
 }
예제 #3
0
 @Override
 public void write(Object o, ByteArrayDataOutput dat) {
   dat.writeByte((Byte) o);
 }