ServerExceptionEvent can be fired off main

This commit is contained in:
Shane Freeder 2019-07-18 08:58:23 +01:00
parent 22e3d2d3a7
commit e1fb590ee6

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add exception reporting event
diff --git a/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java b/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java
new file mode 100644
index 00000000..d3b00f74
index 00000000..2f573299
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java
@@ -0,0 +0,0 @@
@ -14,6 +14,7 @@ index 00000000..d3b00f74
+
+import com.google.common.base.Preconditions;
+import org.apache.commons.lang.Validate;
+import org.bukkit.Bukkit;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import com.destroystokyo.paper.exception.ServerException;
@ -27,6 +28,7 @@ index 00000000..d3b00f74
+ @NotNull private ServerException exception;
+
+ public ServerExceptionEvent(@NotNull ServerException exception) {
+ super(!Bukkit.isPrimaryThread());
+ this.exception = Preconditions.checkNotNull(exception, "exception");
+ }
+