Ejemplo n.º 1
0
 // custom packet
 public void readPacketData(ByteArrayDataInput data) {
   try {
     this.buttonId = data.readByte();
     this.probability = (int) data.readByte();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 3
0
 @Override
 public Object read(ByteArrayDataInput dat) {
   return dat.readByte();
 }