From e121e62b1daf288aa673ab18fed5ea6c549e6bfb Mon Sep 17 00:00:00 2001 From: Bryan Terce Date: Thu, 6 Apr 2017 22:06:03 -0700 Subject: [PATCH] (Hotfix) Possibly work around #2 for the time being --- build.gradle | 2 +- .../btk5h/skriptjson/skript/EffJSONToVariable.java | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index f641e7a..36c542c 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ */ group 'com.btk5h' -version '1.1.0' +version '1.1.1' apply plugin: 'java' diff --git a/src/main/java/com/btk5h/skriptjson/skript/EffJSONToVariable.java b/src/main/java/com/btk5h/skriptjson/skript/EffJSONToVariable.java index 153e8b0..fdee918 100644 --- a/src/main/java/com/btk5h/skriptjson/skript/EffJSONToVariable.java +++ b/src/main/java/com/btk5h/skriptjson/skript/EffJSONToVariable.java @@ -75,13 +75,17 @@ protected void execute(Event e) { } } + private void setVariable(Event e, String name, Object obj) { + Variables.setVariable(name.toLowerCase(Locale.ENGLISH), obj, e, isLocal); + } + private void mapFirst(Event e, String name, Object obj) { if (obj instanceof JSONObject) { handleObject(e, name, (JSONObject) obj); } else if (obj instanceof JSONArray) { handleArray(e, name, (JSONArray) obj); } else { - Variables.setVariable(name, obj, e, isLocal); + setVariable(e, name, obj); } } @@ -89,16 +93,16 @@ private void map(Event e, String name, Object obj) { if (obj instanceof JSONObject) { if (((JSONObject) obj).containsKey("__javaclass__") || ((JSONObject) obj).containsKey("__skriptclass__")) { - Variables.setVariable(name, Serializers.deserialize(((JSONObject) obj)), e, isLocal); + setVariable(e, name, Serializers.deserialize(((JSONObject) obj))); } else { - Variables.setVariable(name, true, e, isLocal); + setVariable(e, name, true); handleObject(e, name, (JSONObject) obj); } } else if (obj instanceof JSONArray) { - Variables.setVariable(name, true, e, isLocal); + setVariable(e, name, true); handleArray(e, name, (JSONArray) obj); } else { - Variables.setVariable(name, obj, e, isLocal); + setVariable(e, name, obj); } }