2021-06-11 14:02:28 +02:00
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
2024-10-25 22:19:27 +02:00
index a3683d27641258114d2d96c049ad6764bc0f81da..4e8b37ea913aa5f6ecfa7550b5a90a20ff4f88da 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
2024-10-23 17:13:43 +02:00
@@ -2352,13 +2352,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
2021-06-11 14:02:28 +02:00
if (this.isEnforceWhitelist()) {
PlayerList playerlist = source.getServer().getPlayerList();
UserWhiteList whitelist = playerlist.getWhiteList();
2024-01-20 12:50:16 +01:00
+ if (!((DedicatedServer) getServer()).getProperties().whiteList.get()) return; // Paper - whitelist not enabled
2021-06-11 14:02:28 +02:00
List<ServerPlayer> list = Lists.newArrayList(playerlist.getPlayers());
Iterator iterator = list.iterator();
2021-10-07 20:11:15 +02:00
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)
2024-06-13 22:57:13 +02:00
entityplayer.connection.disconnect((Component) Component.translatable("multiplayer.disconnect.not_whitelisted"));
2021-10-07 20:11:15 +02:00
}
}