diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java index cfb458bc03..443230f754 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java @@ -312,37 +312,6 @@ public boolean runWithCheck(ScriptContainer scriptContainer, String s, String lo return runWithCheck(new ScriptPath(scriptContainer, s), held); } - public boolean runGenericCheck(String inputValue, String trueValue) { - if (inputValue != null) { - trueValue = CoreUtilities.toLowerCase(trueValue); - inputValue = CoreUtilities.toLowerCase(inputValue); - if (inputValue.equals(trueValue)) { - return true; - } - Pattern regexd = regexHandle(inputValue); - if (!equalityCheck(trueValue, inputValue, regexd)) { - return false; - } - } - return true; - } - - public boolean runGenericSwitchCheck(ScriptPath path, String switchName, String value) { - String with = path.switches.get(switchName); - if (with != null) { - value = CoreUtilities.toLowerCase(value); - with = CoreUtilities.toLowerCase(with); - if (with.equals(value)) { - return true; - } - Pattern regexd = regexHandle(with); - if (!equalityCheck(value, with, regexd)) { - return false; - } - } - return true; - } - public boolean runWithCheck(ScriptPath path, ItemTag held) { String with = path.switches.get("with"); if (with != null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java index f5e1cad61f..e29367cc3d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java @@ -98,7 +98,7 @@ public boolean matches(ScriptPath path) { return false; } - if (!runGenericSwitchCheck(path, "cause", cause.asString())) { + if (!runGenericSwitchCheck(path, "cause", cause == null ? null : cause.asString())) { return false; }