3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

Skript event executor classes do not have an enclosing method

Dieser Commit ist enthalten in:
Zach Brown 2016-01-09 18:43:35 -06:00
Ursprung 9172103531
Commit 414a748893

Datei anzeigen

@ -1,4 +1,4 @@
From 3957d5f9f79ab7212bfcbc2204e4edd89c3c7600 Mon Sep 17 00:00:00 2001 From a9ddd6b7178106c99145a5c7e955a782aa24d657 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Fri, 8 Jan 2016 23:12:28 -0600 Date: Fri, 8 Jan 2016 23:12:28 -0600
Subject: [PATCH] Timings v2 Subject: [PATCH] Timings v2
@ -824,10 +824,10 @@ index 0000000..2993971
+} +}
diff --git a/src/main/java/org/spigotmc/timings/TimedEventExecutor.java b/src/main/java/org/spigotmc/timings/TimedEventExecutor.java diff --git a/src/main/java/org/spigotmc/timings/TimedEventExecutor.java b/src/main/java/org/spigotmc/timings/TimedEventExecutor.java
new file mode 100644 new file mode 100644
index 0000000..a704015 index 0000000..0674238
--- /dev/null --- /dev/null
+++ b/src/main/java/org/spigotmc/timings/TimedEventExecutor.java +++ b/src/main/java/org/spigotmc/timings/TimedEventExecutor.java
@@ -0,0 +1,73 @@ @@ -0,0 +1,81 @@
+/* +/*
+ * This file is licensed under the MIT License (MIT). + * This file is licensed under the MIT License (MIT).
+ * + *
@ -880,9 +880,17 @@ index 0000000..a704015
+ 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);