From 106782bc63f9546c43a02425f9c304a89be71716 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Sat, 9 Jan 2016 18:43:35 -0600 Subject: [PATCH] Skript event executor classes do not have an enclosing method --- Spigot-API-Patches/Timings-v2.patch | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Spigot-API-Patches/Timings-v2.patch b/Spigot-API-Patches/Timings-v2.patch index 6316d5876f..8557831913 100644 --- a/Spigot-API-Patches/Timings-v2.patch +++ b/Spigot-API-Patches/Timings-v2.patch @@ -880,9 +880,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + String id; + + 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(); + boolean verbose = "BlockPhysicsEvent".equals(eventName) || "Drain".equals(eventName) || "Fill".equals(eventName);