Paper/patches/server/0484-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch
Nassim Jahnke d5f1ffc2e6
Remove somewhat broken patch
With the new chunk system it doesn't hurt too much to (temporarily) remove this until implemented in a safer manner
2022-12-19 11:46:55 +01: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 8ce413404930cca3a470bb58d73b9bd0c9a9c2d2..f445f6d382c8fe3def980ed3f8517bbf3b75dfed 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2105,13 +2105,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"));
}
}