1
0
mirror of https://github.com/Suiranoil/SkinRestorer.git synced 2026-01-16 04:42:12 +00:00

register profile related type adapters

This commit is contained in:
2024-08-28 22:45:29 +03:00
parent 2f5edc7069
commit 3492f82214

View File

@@ -1,16 +1,28 @@
package net.lionarius.skinrestorer.util;
import com.google.gson.*;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import com.mojang.authlib.properties.PropertyMap;
import com.mojang.util.UUIDTypeAdapter;
import net.lionarius.skinrestorer.SkinRestorer;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.UUID;
public final class JsonUtils {
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
private static final Gson GSON = new GsonBuilder()
.registerTypeAdapter(UUID.class, new UUIDTypeAdapter())
.registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer())
.registerTypeAdapter(GameProfile.class, new GameProfile.Serializer())
.setPrettyPrinting()
.create();
private JsonUtils() {}