diff --git a/src/main/java/noppes/npcs/util/NBTJsonUtil.java b/src/main/java/noppes/npcs/util/NBTJsonUtil.java index b6d25a333..8332977c6 100644 --- a/src/main/java/noppes/npcs/util/NBTJsonUtil.java +++ b/src/main/java/noppes/npcs/util/NBTJsonUtil.java @@ -36,7 +36,7 @@ public class NBTJsonUtil { json.cut(1); if(json.startsWith("}")) return; - int index = json.findObjectColonIndex(); + int index = json.indexOf(":"); if(index < 1) throw new JsonException("Expected key after ," ,json); @@ -306,24 +306,6 @@ public class NBTJsonUtil { return "Line: " + lines.length + ", Pos: " + pos + ", Text: " + line; } - public int findObjectColonIndex() { - int trueQuotesAmount = 0; - - for (int i = 0; i < text.length(); i++) { - if (text.charAt(i) == '"') { - if (i > 1 && text.charAt(i-1) != '\\' || i == 0) { - trueQuotesAmount++; - } - } - - if (trueQuotesAmount == 2) { - return text.indexOf(":", i); - } - } - - return -1; - } - public boolean startsWith(String... ss) { for(String s : ss) if(text.startsWith(s))