Paper/patches/server/0501-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch
Nassim Jahnke 0ddd20c6f7
Updated Upstream (CraftBukkit/Spigot)
Upstream has released updates that appear 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:
ead719a65 SPIGOT-7136: Cancelling PlayerInteractEntityEvent with the Allay desyncs
8468e167e SPIGOT-7137: StructureGrowEvent isFromBonemeal and getPlayer have incorrect values
d45057c59 SPIGOT-7089: Crash when command blocks attempt to load worlds

Spigot Changes:
450dcaa8 Rebuild patches
2022-08-14 10:03:13 +02:00

28 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 3 Oct 2020 22:00:27 -0500
Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
not enabled
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index dbe70160ac703e74613ac65bd62950a5cc951d4c..f02fc7d6d8d0aba84be5e85c8de0ccc0e5a01c78 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2098,13 +2098,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.isEnforceWhitelist()) {
PlayerList playerlist = source.getServer().getPlayerList();
UserWhiteList whitelist = playerlist.getWhiteList();
+ if (!((DedicatedServer)getServer()).getProperties().whiteList.get()) return; // Paper - white list not enabled
List<ServerPlayer> list = Lists.newArrayList(playerlist.getPlayers());
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
- if (!whitelist.isWhiteListed(entityplayer.getGameProfile())) {
+ if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
entityplayer.connection.disconnect(Component.translatable("multiplayer.disconnect.not_whitelisted"));
}
}