UnitType serializer set
This commit is contained in:
@@ -165,6 +165,18 @@ public class JsonIO{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
json.setSerializer(UnitType.class, new Serializer<>(){
|
||||||
|
@Override
|
||||||
|
public void write(Json json, UnitType object, Class knownType){
|
||||||
|
json.writeValue(object.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UnitType read(Json json, JsonValue jsonData, Class type){
|
||||||
|
return Vars.content.getByName(ContentType.unit, jsonData.asString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
json.setSerializer(ItemStack.class, new Serializer<>(){
|
json.setSerializer(ItemStack.class, new Serializer<>(){
|
||||||
@Override
|
@Override
|
||||||
public void write(Json json, ItemStack object, Class knownType){
|
public void write(Json json, ItemStack object, Class knownType){
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
if(JavaVersion.current().ordinal() < JavaVersion.VERSION_14.ordinal() && System.getenv("JITPACK") != "true"){
|
if(JavaVersion.current().ordinal() < JavaVersion.VERSION_14.ordinal()){
|
||||||
throw new GradleException("!!! YOU MUST USE JAVA 14 OR ABOVE TO COMPILE AND RUN MINDUSTRY !!! Read the README. Your version: ${System.properties["java.version"]}")
|
throw new GradleException("!!! YOU MUST USE JAVA 14 OR ABOVE TO COMPILE AND RUN MINDUSTRY !!! Read the README. Your version: ${System.properties["java.version"]}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user