Skript event executor classes do not have an enclosing method

This commit is contained in:
Zach Brown 2016-01-09 18:43:35 -06:00
parent 097ffc44c1
commit 106782bc63

View file

@ -880,9 +880,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ String id; + String id;
+ +
+ if (method == null) { + if (method == null) {
+ method = executor.getClass().getEnclosingMethod(); + if (executor.getClass().getEnclosingClass() != null) { // Oh Skript, how we love you
+ method = executor.getClass().getEnclosingMethod();
+ }
+ } + }
+ id = method.getDeclaringClass().getName(); +
+ if (method != null) {
+ id = method.getDeclaringClass().getName();
+ } else {
+ id = "null";
+ }
+
+ +
+ final String eventName = eventClass.getSimpleName(); + final String eventName = eventClass.getSimpleName();
+ boolean verbose = "BlockPhysicsEvent".equals(eventName) || "Drain".equals(eventName) || "Fill".equals(eventName); + boolean verbose = "BlockPhysicsEvent".equals(eventName) || "Drain".equals(eventName) || "Fill".equals(eventName);