Planet background system

This commit is contained in:
Anuken
2021-09-17 11:23:32 -04:00
parent 76b0ca53c5
commit e08e51b939
7 changed files with 79 additions and 19 deletions

View File

@@ -163,6 +163,19 @@ public class JsonIO{
}
});
json.setSerializer(Planet.class, new Serializer<>(){
@Override
public void write(Json json, Planet object, Class knownType){
json.writeValue(object.name);
}
@Override
public Planet read(Json json, JsonValue jsonData, Class type){
Planet block = Vars.content.getByName(ContentType.planet, jsonData.asString());
return block == null ? Planets.serpulo : block;
}
});
json.setSerializer(Weather.class, new Serializer<>(){
@Override
public void write(Json json, Weather object, Class knownType){