Some minor improvements to ConfigHelper

This commit is contained in:
Cheeserolls 2015-05-24 14:51:48 +01:00
parent 957f1de812
commit 17ea1755e8

View file

@ -36,7 +36,7 @@ public class ConfigHelper
public static Gson serializer = new GsonBuilder().setPrettyPrinting().create();
public static JsonParser parser = new JsonParser();
public JsonBlockState blockStateParser = new JsonBlockState();
public WrappedJsonObject root;
public WrappedJsonObject root = null;
public ArrayList<String> messages = new ArrayList<String>();
@ -60,6 +60,11 @@ public class ConfigHelper
this.parse(jsonString);
}
public boolean isNull()
{
return this.root == null;
}
public void parse(String jsonString)
{
this.root = null;
@ -157,13 +162,13 @@ public class ConfigHelper
private static enum Types {BOOLEAN, STRING, INTEGER, FLOAT, BLOCKSTATE}
private class WrappedJsonObject
public class WrappedJsonObject
{
private JsonObject obj;
private ConfigHelper conf;
protected JsonObject obj;
protected ConfigHelper conf;
WrappedJsonObject(ConfigHelper conf, JsonObject obj)
public WrappedJsonObject(ConfigHelper conf, JsonObject obj)
{
this.obj = obj;
this.conf = conf;
@ -377,6 +382,8 @@ public class ConfigHelper
return null;
}
}
}
}
}