mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 04:17:44 +01:00
Fix kicking ops when whitelist is reloaded (MC-171420) (#6742)
This commit is contained in:
parent
7241ee9bc1
commit
1bd2f3e523
@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
|
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(org.spigotmc.SpigotConfig.whitelistMessage); // Paper - use configurable message
|
- entityplayer.connection.disconnect(org.spigotmc.SpigotConfig.whitelistMessage); // Paper - use configurable message
|
||||||
+ entityplayer.connection.disconnect(org.spigotmc.SpigotConfig.whitelistMessage, org.bukkit.event.player.PlayerKickEvent.Cause.WHITELIST); // Paper - use configurable message
|
+ entityplayer.connection.disconnect(org.spigotmc.SpigotConfig.whitelistMessage, org.bukkit.event.player.PlayerKickEvent.Cause.WHITELIST); // Paper - use configurable message
|
||||||
}
|
}
|
||||||
|
@ -17,3 +17,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
List<ServerPlayer> list = Lists.newArrayList(playerlist.getPlayers());
|
List<ServerPlayer> list = Lists.newArrayList(playerlist.getPlayers());
|
||||||
Iterator iterator = list.iterator();
|
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"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
|
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"));
|
- entityplayer.connection.disconnect(new TranslatableComponent("multiplayer.disconnect.not_whitelisted"));
|
||||||
+ entityplayer.connection.disconnect(org.spigotmc.SpigotConfig.whitelistMessage); // Paper - use configurable message
|
+ entityplayer.connection.disconnect(org.spigotmc.SpigotConfig.whitelistMessage); // Paper - use configurable message
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user