From fbdb33981ec7fcfc09e406ad31d4ce2ce57478e4 Mon Sep 17 00:00:00 2001 From: Aikar <aikar@aikar.co> Date: Wed, 24 Feb 2016 00:32:44 -0600 Subject: [PATCH] Fix ServerListPingEvent flagging as Async --- ...erverListPingEvent-flagging-as-Async.patch | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Spigot-API-Patches/Fix-ServerListPingEvent-flagging-as-Async.patch diff --git a/Spigot-API-Patches/Fix-ServerListPingEvent-flagging-as-Async.patch b/Spigot-API-Patches/Fix-ServerListPingEvent-flagging-as-Async.patch new file mode 100644 index 0000000000..d4d015a511 --- /dev/null +++ b/Spigot-API-Patches/Fix-ServerListPingEvent-flagging-as-Async.patch @@ -0,0 +1,52 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar <aikar@aikar.co> +Date: Wed, 24 Feb 2016 00:57:22 -0500 +Subject: [PATCH] Fix ServerListPingEvent flagging as Async + +This event can sometimes fire Async, set the proper boolean + +diff --git a/src/main/java/org/bukkit/event/server/ServerEvent.java b/src/main/java/org/bukkit/event/server/ServerEvent.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/event/server/ServerEvent.java ++++ b/src/main/java/org/bukkit/event/server/ServerEvent.java +@@ -0,0 +0,0 @@ + package org.bukkit.event.server; + ++import org.bukkit.Bukkit; + import org.bukkit.event.Event; + + /** + * Miscellaneous server events + */ + public abstract class ServerEvent extends Event { ++ // Paper start ++ public ServerEvent(boolean isAsync) { ++ super(isAsync); ++ } ++ ++ public ServerEvent() { ++ super(!Bukkit.isPrimaryThread()); ++ } ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java ++++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +@@ -0,0 +0,0 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player> + private int maxPlayers; + + public ServerListPingEvent(final InetAddress address, final String motd, final int numPlayers, final int maxPlayers) { ++ super(); // Paper - Is this event being fired async? + Validate.isTrue(numPlayers >= 0, "Cannot have negative number of players online", numPlayers); + this.address = address; + this.motd = motd; +@@ -0,0 +0,0 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player> + * @param maxPlayers the max number of players + */ + protected ServerListPingEvent(final InetAddress address, final String motd, final int maxPlayers) { ++ super(); // Paper - Is this event being fired async? + this.numPlayers = MAGIC_PLAYER_COUNT; + this.address = address; + this.motd = motd; +-- \ No newline at end of file