2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2019-03-02 22:23:06 +01:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sat, 2 Mar 2019 16:12:35 -0500
|
|
|
|
Subject: [PATCH] MC-145260: Fix Whitelist On/Off inconsistency
|
|
|
|
|
|
|
|
mojang stored whitelist state in 2 places (Whitelist Object, PlayerList)
|
|
|
|
|
|
|
|
some things checked PlayerList, some checked object. This moves
|
|
|
|
everything to the Whitelist object.
|
|
|
|
|
|
|
|
https://github.com/PaperMC/Paper/issues/1880
|
|
|
|
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-05-16 01:42:36 +02:00
|
|
|
index 7515e9ddbc89de882373469cf3c46046c76af974..1a4ae92065f729ec521752bb87df8343d747f566 100644
|
2021-03-16 08:19:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-03-16 14:04:28 +01:00
|
|
|
@@ -55,6 +55,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutViewDistance;
|
|
|
|
import net.minecraft.network.protocol.game.PacketPlayOutWorldBorder;
|
|
|
|
import net.minecraft.resources.ResourceKey;
|
|
|
|
import net.minecraft.server.AdvancementDataPlayer;
|
|
|
|
+import net.minecraft.server.MCUtil;
|
|
|
|
import net.minecraft.server.MinecraftServer;
|
|
|
|
import net.minecraft.server.ScoreboardServer;
|
|
|
|
import net.minecraft.server.level.DemoPlayerInteractManager;
|
|
|
|
@@ -1016,9 +1017,9 @@ public abstract class PlayerList {
|
2019-03-02 22:23:06 +01:00
|
|
|
}
|
|
|
|
public boolean isWhitelisted(GameProfile gameprofile, org.bukkit.event.player.PlayerLoginEvent loginEvent) {
|
|
|
|
boolean isOp = this.operators.d(gameprofile);
|
|
|
|
- boolean isWhitelisted = !this.hasWhitelist || isOp || this.whitelist.d(gameprofile);
|
|
|
|
+ boolean isWhitelisted = !this.getHasWhitelist() || isOp || this.whitelist.d(gameprofile);
|
|
|
|
final com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent event;
|
|
|
|
- event = new com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent(MCUtil.toBukkit(gameprofile), this.hasWhitelist, isWhitelisted, isOp, org.spigotmc.SpigotConfig.whitelistMessage);
|
|
|
|
+ event = new com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent(MCUtil.toBukkit(gameprofile), this.getHasWhitelist(), isWhitelisted, isOp, org.spigotmc.SpigotConfig.whitelistMessage);
|
|
|
|
event.callEvent();
|
|
|
|
if (!event.isWhitelisted()) {
|
|
|
|
if (loginEvent != null) {
|