mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-09 04:09:54 +01:00
1718f61bf8
Doesn't compile yet. CraftBukkit Changes: 90d6905b Repackage NMS 69cf961d Repackage patches Spigot Changes: 79d53c28 Repackage NMS
24 lines
1.2 KiB
Diff
24 lines
1.2 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/LoginListener.java b/src/main/java/net/minecraft/server/network/LoginListener.java
|
|
index 9f87503c58f64bbfa829faa58600d7d9e64aecf1..651b84b3bba316407a217c941be4c20074c5bb90 100644
|
|
--- a/src/main/java/net/minecraft/server/network/LoginListener.java
|
|
+++ b/src/main/java/net/minecraft/server/network/LoginListener.java
|
|
@@ -68,6 +68,12 @@ public class LoginListener implements PacketLoginInListener {
|
|
}
|
|
|
|
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.g == LoginListener.EnumProtocolState.READY_TO_ACCEPT) {
|
|
this.c();
|
|
} else if (this.g == LoginListener.EnumProtocolState.DELAY_ACCEPT) {
|