Dieser Commit ist enthalten in:
Ursprung
ba106edd58
Commit
2a91330453
@ -37,28 +37,4 @@ public class ModSettingsAdapter implements JsonSerializer<ModSettings> {
|
||||
object.add("properties", properties);
|
||||
return object;
|
||||
}
|
||||
|
||||
private ModSettings.ModSetting deserializeModSetting(JsonObject object) {
|
||||
JsonObject propertiesObject = object.get("properties").getAsJsonObject();
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
for (Map.Entry<String, JsonElement> entry : propertiesObject.entrySet()) {
|
||||
if (!entry.getValue().isJsonPrimitive()) {
|
||||
continue;
|
||||
}
|
||||
JsonPrimitive primitive = entry.getValue().getAsJsonPrimitive();
|
||||
Object toSet;
|
||||
if (primitive.isString()) {
|
||||
toSet = primitive.getAsString();
|
||||
} else if (primitive.isNumber()) {
|
||||
toSet = primitive.getAsNumber();
|
||||
} else if (primitive.isBoolean()) {
|
||||
toSet = primitive.getAsBoolean();
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
properties.put(entry.getKey(), toSet);
|
||||
}
|
||||
return new ModSettings.ModSetting(object.get("enabled").getAsBoolean(), properties);
|
||||
}
|
||||
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren