You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
705 B
Java
24 lines
705 B
Java
package net.minecraftforge.gradle;
|
|
|
|
import java.lang.reflect.Type;
|
|
|
|
import com.google.gson.*;
|
|
import com.mojang.authlib.properties.Property;
|
|
import com.mojang.authlib.properties.PropertyMap;
|
|
|
|
public class OldPropertyMapSerializer implements JsonSerializer<PropertyMap> {
|
|
|
|
@Override
|
|
public JsonElement serialize(PropertyMap src, Type typeOfSrc, JsonSerializationContext context) {
|
|
JsonObject out = new JsonObject();
|
|
for (String key : src.keySet()) {
|
|
JsonArray jsa = new JsonArray();
|
|
for (Property p : src.get(key)) {
|
|
jsa.add(new JsonPrimitive(p.getValue()));
|
|
}
|
|
out.add(key, jsa);
|
|
}
|
|
return out;
|
|
}
|
|
}
|