ServerExceptionEvent can be fired off main

This commit is contained in:
Shane Freeder 2019-07-18 08:58:23 +01:00
parent 920ad7c742
commit a41d51f098
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C

View File

@ -1,4 +1,4 @@
From 40c4b5f00a9beeed4c2533dccb9e786bce2862f7 Mon Sep 17 00:00:00 2001
From 21c928ac4a621dd3024e55743da904c9f3423e37 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 29 Feb 2016 20:24:35 -0600
Subject: [PATCH] Add exception reporting event
@ -6,14 +6,15 @@ 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 +1,41 @@
@@ -0,0 +1,43 @@
+package com.destroystokyo.paper.event.server;
+
+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");
+ }
+