Cleanup
This commit is contained in:
@@ -75,7 +75,7 @@ public class JsonIO{
|
||||
|
||||
//TODO this is terrible
|
||||
|
||||
json.setSerializer(Sector.class, new Serializer<Sector>(){
|
||||
json.setSerializer(Sector.class, new Serializer<>(){
|
||||
@Override
|
||||
public void write(Json json, Sector object, Class knownType){
|
||||
json.writeValue(object.planet.name + "-" + object.id);
|
||||
@@ -88,7 +88,7 @@ public class JsonIO{
|
||||
}
|
||||
});
|
||||
|
||||
json.setSerializer(SectorPreset.class, new Serializer<SectorPreset>(){
|
||||
json.setSerializer(SectorPreset.class, new Serializer<>(){
|
||||
@Override
|
||||
public void write(Json json, SectorPreset object, Class knownType){
|
||||
json.writeValue(object.name);
|
||||
@@ -100,7 +100,7 @@ public class JsonIO{
|
||||
}
|
||||
});
|
||||
|
||||
json.setSerializer(Liquid.class, new Serializer<Liquid>(){
|
||||
json.setSerializer(Liquid.class, new Serializer<>(){
|
||||
@Override
|
||||
public void write(Json json, Liquid object, Class knownType){
|
||||
json.writeValue(object.name);
|
||||
@@ -109,12 +109,12 @@ public class JsonIO{
|
||||
@Override
|
||||
public Liquid read(Json json, JsonValue jsonData, Class type){
|
||||
if(jsonData.asString() == null) return Liquids.water;
|
||||
Liquid i = Vars.content.getByName(ContentType.liquid, jsonData.asString());
|
||||
Liquid i = Vars.content.getByName(ContentType.liquid, jsonData.asString());
|
||||
return i == null ? Liquids.water : i;
|
||||
}
|
||||
});
|
||||
|
||||
json.setSerializer(Item.class, new Serializer<Item>(){
|
||||
json.setSerializer(Item.class, new Serializer<>(){
|
||||
@Override
|
||||
public void write(Json json, Item object, Class knownType){
|
||||
json.writeValue(object.name);
|
||||
@@ -123,12 +123,12 @@ public class JsonIO{
|
||||
@Override
|
||||
public Item read(Json json, JsonValue jsonData, Class type){
|
||||
if(jsonData.asString() == null) return Items.copper;
|
||||
Item i = Vars.content.getByName(ContentType.item, jsonData.asString());
|
||||
Item i = Vars.content.getByName(ContentType.item, jsonData.asString());
|
||||
return i == null ? Items.copper : i;
|
||||
}
|
||||
});
|
||||
|
||||
json.setSerializer(Team.class, new Serializer<Team>(){
|
||||
json.setSerializer(Team.class, new Serializer<>(){
|
||||
@Override
|
||||
public void write(Json json, Team object, Class knownType){
|
||||
json.writeValue(object.id);
|
||||
@@ -140,7 +140,7 @@ public class JsonIO{
|
||||
}
|
||||
});
|
||||
|
||||
json.setSerializer(Block.class, new Serializer<Block>(){
|
||||
json.setSerializer(Block.class, new Serializer<>(){
|
||||
@Override
|
||||
public void write(Json json, Block object, Class knownType){
|
||||
json.writeValue(object.name);
|
||||
@@ -153,7 +153,7 @@ public class JsonIO{
|
||||
}
|
||||
});
|
||||
|
||||
json.setSerializer(Weather.class, new Serializer<Weather>(){
|
||||
json.setSerializer(Weather.class, new Serializer<>(){
|
||||
@Override
|
||||
public void write(Json json, Weather object, Class knownType){
|
||||
json.writeValue(object.name);
|
||||
@@ -165,7 +165,7 @@ public class JsonIO{
|
||||
}
|
||||
});
|
||||
|
||||
json.setSerializer(ItemStack.class, new Serializer<ItemStack>(){
|
||||
json.setSerializer(ItemStack.class, new Serializer<>(){
|
||||
@Override
|
||||
public void write(Json json, ItemStack object, Class knownType){
|
||||
json.writeObjectStart();
|
||||
@@ -180,7 +180,7 @@ public class JsonIO{
|
||||
}
|
||||
});
|
||||
|
||||
json.setSerializer(UnlockableContent.class, new Serializer<UnlockableContent>(){
|
||||
json.setSerializer(UnlockableContent.class, new Serializer<>(){
|
||||
@Override
|
||||
public void write(Json json, UnlockableContent object, Class knownType){
|
||||
json.writeValue(object.name);
|
||||
|
||||
Reference in New Issue
Block a user