From 0d1e18795bf2c9623d5a9a860d66d964e4131c6b Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Thu, 7 Oct 2021 20:11:15 +0200 Subject: [PATCH] Fix kicking ops when whitelist is reloaded (MC-171420) (#6742) --- ...kicking-non-whitelisted-player-when-white-l.patch | 12 ++++++++++-- ...ced-whitelist-use-configurable-kick-message.patch | 4 ++-- patches/server/0692-Add-PlayerKickEvent-causes.patch | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/patches/server/0530-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/0530-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch index 0a9d3f245..3c5c6925a 100644 --- a/patches/server/0530-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch +++ b/patches/server/0530-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index bb18848f2b91b80ab5099c00b423738bbb2560e8..c2c84eb3d43968424ed995fde312a6ac2ba74b2e 100644 +index bb18848f2b91b80ab5099c00b423738bbb2560e8..0747007ea6d779d1fd957efcb414e28faaa3da3b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2108,6 +2108,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 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(new TranslatableComponent("multiplayer.disconnect.not_whitelisted")); + } + } diff --git a/patches/server/0643-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0643-forced-whitelist-use-configurable-kick-message.patch index 3b1272d70..4710e758e 100644 --- a/patches/server/0643-forced-whitelist-use-configurable-kick-message.patch +++ b/patches/server/0643-forced-whitelist-use-configurable-kick-message.patch @@ -5,7 +5,7 @@ Subject: [PATCH] forced whitelist: use configurable kick message diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c8b68b5a996491dcd668f929badf294386832388..33dcb39428c3bd24daa600c2b486954466d81eef 100644 +index cfcc29ed3b1396b1429af14195f420c550653aa5..84afe36963178aa0319e219244ddbe6f0b91260b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -74,7 +74,6 @@ import net.minecraft.nbt.NbtOps; @@ -19,7 +19,7 @@ index c8b68b5a996491dcd668f929badf294386832388..33dcb39428c3bd24daa600c2b4869544 @@ -2124,7 +2123,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop