예제 #1
0
 // custom packet
 public void readPacketData(ByteArrayDataInput data) {
   try {
     this.buttonId = data.readByte();
     this.probability = (int) data.readByte();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
예제 #2
0
 @Override
 public FMLPacket consumePacket(byte[] data) {
   sentModList = Lists.newArrayList();
   ByteArrayDataInput in = ByteStreams.newDataInput(data);
   int listSize = in.readInt();
   for (int i = 0; i < listSize; i++) {
     sentModList.add(in.readUTF());
   }
   try {
     compatibilityLevel = in.readByte();
   } catch (IllegalStateException e) {
     FMLLog.fine("No compatibility byte found - the server is too old");
   }
   return this;
 }
예제 #3
0
 @Override
 public Object read(ByteArrayDataInput dat) {
   return dat.readByte();
 }