Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: eb2e6578 SPIGOT-5116: Fix concurrent modification exception inside ChunkMapDistance 989f9b3d SPIGOT-4849: Fix server crash when accessing chunks during chunk load/unload/populate events f554183c SPIGOT-5171: Don't fire PlayerTeleportEvent if not actually moving 2349feb8 SPIGOT-5163: Cancelling PlayerBucketFillEvent visually removes the targeted block Spigot Changes: 9a643a6a Remove DataWatcher Locking
70 lines
3.0 KiB
Diff
70 lines
3.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
Date: Sun, 31 Mar 2019 22:02:24 -0700
|
|
Subject: [PATCH] Allow login events to fire only after the server plugins are
|
|
enabled
|
|
|
|
Event threads will simply block until they're ready to accept.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
|
|
index 9e4bc2405..028c23dbe 100644
|
|
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
|
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
|
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
|
|
}
|
|
}
|
|
|
|
+ // Paper start - Delay async prelogin until plugins are ready
|
|
+ private static volatile Object blockingLogins = new Object();
|
|
+
|
|
+ public static void checkStartupAndBlock() {
|
|
+ final Object lock = LoginListener.blockingLogins;
|
|
+ if (lock != null) {
|
|
+ synchronized (lock) {
|
|
+ for (;;) {
|
|
+ if (LoginListener.blockingLogins == null) {
|
|
+ return;
|
|
+ }
|
|
+ try {
|
|
+ lock.wait();
|
|
+ } catch (final InterruptedException ignore) {// handled by the if statement above
|
|
+ Thread.currentThread().interrupt();
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
+ public static void allowLogins() {
|
|
+ final Object lock = LoginListener.blockingLogins;
|
|
+ synchronized (lock) {
|
|
+ LoginListener.blockingLogins = null;
|
|
+ lock.notifyAll();
|
|
+ }
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
// Spigot start
|
|
public class LoginHandler {
|
|
|
|
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener {
|
|
return;
|
|
}
|
|
// Paper end
|
|
+ LoginListener.checkStartupAndBlock(); // Paper - Delay async login events until plugins are ready
|
|
String playerName = i.getName();
|
|
java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress();
|
|
java.util.UUID uniqueId = i.getId();
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index 1e2f2f8b9..55e8db8a0 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
// Paper end
|
|
|
|
this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
|
|
+ LoginListener.allowLogins(); // Paper - Allow logins once postworld
|
|
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
|
|
// CraftBukkit end
|
|
|
|
--
|