mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-06 02:42:14 +01:00
a207d14a0e
Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
24 lines
1.3 KiB
Diff
24 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
Date: Sun, 2 Jul 2017 21:35:56 -0500
|
|
Subject: [PATCH] Block player logins during server shutdown
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
index e3c1460c580ea348ee6d436018244441a5a1206e..fca291c34c67d552590320c6e6e9c08e21d19fa8 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
@@ -66,6 +66,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
|
}
|
|
|
|
public void tick() {
|
|
+ // Paper start - Do not allow logins while the server is shutting down
|
|
+ if (!MinecraftServer.getServer().isRunning()) {
|
|
+ this.disconnect(org.bukkit.craftbukkit.util.CraftChatMessage.fromString(org.spigotmc.SpigotConfig.restartMessage)[0]);
|
|
+ return;
|
|
+ }
|
|
+ // Paper end
|
|
if (this.state == ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT) {
|
|
this.handleAcceptedLogin();
|
|
} else if (this.state == ServerLoginPacketListenerImpl.State.DELAY_ACCEPT) {
|