More plugin customization / Renamed Rectangle

This commit is contained in:
Anuken
2019-12-26 22:44:15 -05:00
parent 6080a7e4bc
commit d6d6dc29dc
35 changed files with 166 additions and 90 deletions

View File

@@ -20,7 +20,7 @@ public class JsonIO{
@Override
public void writeValue(Object value, Class knownType, Class elementType){
if(value instanceof mindustry.ctype.MappableContent){
if(value instanceof MappableContent){
try{
getWriter().value(((MappableContent)value).name);
}catch(IOException e){
@@ -95,6 +95,18 @@ public class JsonIO{
}
});
json.setSerializer(Team.class, new Serializer<Team>(){
@Override
public void write(Json json, Team object, Class knownType){
json.writeValue(object.id);
}
@Override
public Team read(Json json, JsonValue jsonData, Class type){
return Team.get(jsonData.asInt());
}
});
json.setSerializer(Block.class, new Serializer<Block>(){
@Override
public void write(Json json, Block object, Class knownType){