mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
Use playerlist whitelist status instead of properties
The actual property value is final, only the serialized output is changed. This uses the correct value from PlayerList instead Fixes #11878
This commit is contained in:
parent
bdfad1c838
commit
1dd52bed49
2 changed files with 4 additions and 3 deletions
|
@ -1262,11 +1262,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1652,10 +_,11 @@
|
@@ -1651,11 +_,12 @@
|
||||||
|
public void kickUnlistedPlayers(CommandSourceStack commandSource) {
|
||||||
if (this.isEnforceWhitelist()) {
|
if (this.isEnforceWhitelist()) {
|
||||||
PlayerList playerList = commandSource.getServer().getPlayerList();
|
PlayerList playerList = commandSource.getServer().getPlayerList();
|
||||||
|
+ if (!playerList.isUsingWhitelist()) return; // Paper - whitelist not enabled
|
||||||
UserWhiteList whiteList = playerList.getWhiteList();
|
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())) {
|
for (ServerPlayer serverPlayer : Lists.newArrayList(playerList.getPlayers())) {
|
||||||
- if (!whiteList.isWhiteListed(serverPlayer.getGameProfile())) {
|
- if (!whiteList.isWhiteListed(serverPlayer.getGameProfile())) {
|
||||||
|
|
|
@ -883,7 +883,7 @@ public final class CraftServer implements Server {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasWhitelist() {
|
public boolean hasWhitelist() {
|
||||||
return this.getProperties().whiteList.get();
|
return this.playerList.isUsingWhitelist();
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: Temporary calls through to server.properies until its replaced
|
// NOTE: Temporary calls through to server.properies until its replaced
|
||||||
|
|
Loading…
Reference in a new issue