From 17ea1755e88a7d08cbec66272e6421b5f0b8ae3e Mon Sep 17 00:00:00 2001 From: Cheeserolls Date: Sun, 24 May 2015 14:51:48 +0100 Subject: [PATCH] Some minor improvements to ConfigHelper --- .../common/util/config/ConfigHelper.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/biomesoplenty/common/util/config/ConfigHelper.java b/src/main/java/biomesoplenty/common/util/config/ConfigHelper.java index 535568243..59c39f034 100644 --- a/src/main/java/biomesoplenty/common/util/config/ConfigHelper.java +++ b/src/main/java/biomesoplenty/common/util/config/ConfigHelper.java @@ -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 messages = new ArrayList(); @@ -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; } } - } + } + + } \ No newline at end of file