2019-03-20 01:28:15 +01:00
|
|
|
From 1b07518a82ecb065e8b048fbf5dee4498d15c1be Mon Sep 17 00:00:00 2001
|
2016-02-24 07:32:44 +01:00
|
|
|
From: Aikar <aikar@aikar.co>
|
2016-03-01 00:09:49 +01:00
|
|
|
Date: Mon, 29 Feb 2016 20:26:39 -0600
|
2016-02-24 07:32:44 +01:00
|
|
|
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
|
2018-04-09 22:13:08 +02:00
|
|
|
index eb00d6af..70416c81 100644
|
2016-02-24 07:32:44 +01:00
|
|
|
--- a/src/main/java/org/bukkit/event/server/ServerEvent.java
|
|
|
|
+++ b/src/main/java/org/bukkit/event/server/ServerEvent.java
|
|
|
|
@@ -1,9 +1,19 @@
|
|
|
|
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
|
2019-03-20 01:28:15 +01:00
|
|
|
index d873763d..b68d7b2f 100644
|
2016-02-24 07:32:44 +01:00
|
|
|
--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
|
|
|
|
+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
|
2019-03-20 01:28:15 +01:00
|
|
|
@@ -23,6 +23,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
|
2016-02-24 07:32:44 +01:00
|
|
|
private int maxPlayers;
|
|
|
|
|
2019-03-20 01:28:15 +01:00
|
|
|
public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String motd, final int numPlayers, final int maxPlayers) {
|
2016-02-24 07:32:44 +01:00
|
|
|
+ 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;
|
2019-03-20 01:28:15 +01:00
|
|
|
@@ -40,6 +41,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
|
2016-02-24 07:32:44 +01:00
|
|
|
* @param maxPlayers the max number of players
|
|
|
|
*/
|
2019-03-20 01:28:15 +01:00
|
|
|
protected ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String motd, final int maxPlayers) {
|
2016-02-24 07:32:44 +01:00
|
|
|
+ super(); // Paper - Is this event being fired async?
|
|
|
|
this.numPlayers = MAGIC_PLAYER_COUNT;
|
|
|
|
this.address = address;
|
|
|
|
this.motd = motd;
|
|
|
|
--
|
2019-03-20 01:28:15 +01:00
|
|
|
2.21.0
|
2016-02-24 07:32:44 +01:00
|
|
|
|