@@ -0,0 +1,1807 @@
+package openmods.utils.io;%0A%0Aimport java.io.DataInput;%0Aimport java.io.DataOutput;%0Aimport java.io.IOException;%0Aimport java.util.UUID;%0A%0Aimport openmods.utils.ByteUtils;%0A%0Aimport com.google.common.base.Strings;%0Aimport com.mojang.authlib.GameProfile;%0Aimport com.mojang.authlib.properties.Property;%0Aimport com.mojang.authlib.properties.PropertyMap;%0A%0Apublic class GameProfileSerializer implements IStreamSerializer%3CGameProfile%3E %7B%0A%09public static final IStreamSerializer%3CGameProfile%3E INSTANCE = new GameProfileSerializer();%0A%0A%09@Override%0A%09public void writeToStream(GameProfile o, DataOutput output) throws IOException %7B%0A%09%09write(o, output);%0A%09%7D%0A%0A%09@Override%0A%09public GameProfile readFromStream(DataInput input) throws IOException %7B%0A%09%09return read(input);%0A%09%7D%0A%0A%09public static void write(GameProfile o, DataOutput output) throws IOException %7B%0A%09%09final UUID uuid = o.getId();%0A%09%09output.writeUTF(uuid == null? %22%22 : uuid.toString());%0A%09%09output.writeUTF(Strings.nullToEmpty(o.getName()));%0A%09%09final PropertyMap properties = o.getProperties();%0A%09%09ByteUtils.writeVLI(output, properties.size());%0A%09%09for (Property p : properties.values()) %7B%0A%09%09%09output.writeUTF(p.getName());%0A%09%09%09output.writeUTF(p.getValue());%0A%09%09%09output.writeUTF(p.getSignature());%0A%09%09%7D%0A%09%7D%0A%0A%09public static GameProfile read(DataInput input) throws IOException %7B%0A%09%09final String uuidStr = input.readUTF();%0A%09%09UUID uuid = UUID.fromString(uuidStr);%0A%09%09final String name = input.readUTF();%0A%09%09GameProfile result = new GameProfile(uuid, name);%0A%09%09int propertyCount = ByteUtils.readVLI(input);%0A%0A%09%09final PropertyMap properties = result.getProperties();%0A%09%09for (int i = 0; i %3C propertyCount; ++i) %7B%0A%09%09%09String key = input.readUTF();%0A%09%09%09String value = input.readUTF();%0A%09%09%09String signature = input.readUTF();%0A%09%09%09properties.put(key, new Property(key, value, signature));%0A%09%09%7D%0A%0A%09%09return result;%0A%09%7D%0A%7D%0A

Add GameProfile serializer