public static Packet readPacket(DataInputStream datainputstream) { int i = 0; Packet packet = null; datainputstream.mark(16384); try { i = datainputstream.read(); if (i == -1) { return null; } packet = getNewPacket(i); if (packet == null) { throw new IOException((new StringBuilder()).append("Bad packet id ").append(i).toString()); } packet.readPacketData(datainputstream); } catch (EOFException eofexception) { [email protected]("Reached end of stream"); datainputstream.reset(); return null; } var packetcounter = (PacketCounter) field_21904_c.get(Integer.valueOf(i)); if (packetcounter == null) { packetcounter = new PacketCounter(null); field_21904_c.put(Integer.valueOf(i), packetcounter); } packetcounter.func_22150_a(packet.getPacketSize()); field_21903_d++; if (field_21903_d%1000 != 0) ; return packet; }