Skip to content

Commit

Permalink
Use playerlist whitelist status instead of properties
Browse files Browse the repository at this point in the history
The actual property value is final, only the serialized output is changed. This uses the correct value from PlayerList instead
Fixes #11878
  • Loading branch information
kennytv committed Jan 1, 2025
1 parent bdfad1c commit 1dd52be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1262,11 +1262,12 @@
}
}

@@ -1652,10 +_,11 @@
@@ -1651,11 +_,12 @@
public void kickUnlistedPlayers(CommandSourceStack commandSource) {
if (this.isEnforceWhitelist()) {
PlayerList playerList = commandSource.getServer().getPlayerList();
+ if (!playerList.isUsingWhitelist()) return; // Paper - whitelist not enabled
UserWhiteList whiteList = playerList.getWhiteList();
+ if (!((net.minecraft.server.dedicated.DedicatedServer) this).getProperties().whiteList.get()) return; // Paper - whitelist not enabled

for (ServerPlayer serverPlayer : Lists.newArrayList(playerList.getPlayers())) {
- if (!whiteList.isWhiteListed(serverPlayer.getGameProfile())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ public boolean isResourcePackRequired() {

@Override
public boolean hasWhitelist() {
return this.getProperties().whiteList.get();
return this.playerList.isUsingWhitelist();
}

// NOTE: Temporary calls through to server.properies until its replaced
Expand Down

0 comments on commit 1dd52be

Please sign in to comment.