mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-04 15:27:19 +07:00
Switched to HJson content parsing
This commit is contained in:
@ -14,6 +14,7 @@ import io.anuke.arc.util.reflect.Field;
|
||||
import io.anuke.arc.util.reflect.*;
|
||||
import io.anuke.arc.util.serialization.*;
|
||||
import io.anuke.arc.util.serialization.Json.*;
|
||||
import io.anuke.arc.util.serialization.Jval.*;
|
||||
import io.anuke.mindustry.*;
|
||||
import io.anuke.mindustry.content.*;
|
||||
import io.anuke.mindustry.content.TechTree.*;
|
||||
@ -182,7 +183,7 @@ public class ContentParser{
|
||||
}else if(child.name.equals("liquid")){
|
||||
block.consumes.add((Consume)parser.readValue(ConsumeLiquid.class, child));
|
||||
}else if(child.name.equals("power")){
|
||||
if(child.isDouble()){
|
||||
if(child.isNumber()){
|
||||
block.consumes.power(child.asFloat());
|
||||
}else{
|
||||
block.consumes.add((Consume)parser.readValue(ConsumePower.class, child));
|
||||
@ -342,10 +343,7 @@ public class ContentParser{
|
||||
init();
|
||||
}
|
||||
|
||||
//add comments starting with //, but ignore links
|
||||
json = json.replace("http://", "http:~~").replace("https://", "https:~~").replaceAll("//.*?\n","\n").replace("http:~~", "http://").replace("https:~~", "https://");
|
||||
|
||||
JsonValue value = parser.fromJson(null, json);
|
||||
JsonValue value = parser.fromJson(null, Jval.read(json).toString(JsonFormat.plain));
|
||||
if(!parsers.containsKey(type)){
|
||||
throw new SerializationException("No parsers for content type '" + type + "'");
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=4082a8d53d41e79d3eb735d0daf4c0f412066f3e
|
||||
archash=5019282ec7f078174fd4d6794baee85ebfe311ba
|
||||
|
Reference in New Issue
Block a user