2019-04-22 23:36:14 +02:00
|
|
|
From 4ff4f66ea29bd8405f2e5182c9746214f12b53a3 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
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
|
2019-04-22 23:36:14 +02:00
|
|
|
index b7cde4d418..949039f89a 100644
|
2019-03-02 22:23:06 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/JsonList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/JsonList.java
|
|
|
|
@@ -64,6 +64,7 @@ public class JsonList<K, V extends JsonListEntry<K>> {
|
|
|
|
return this.e;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ public void setEnabled(boolean flag) { a(flag); } // Paper - OBFHeLPER
|
|
|
|
public void a(boolean flag) {
|
|
|
|
this.e = flag;
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
2019-04-22 23:36:14 +02:00
|
|
|
index 135d25abd2..408c382d2a 100644
|
2019-03-02 22:23:06 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
|
|
|
@@ -63,7 +63,7 @@ public abstract class PlayerList {
|
|
|
|
// private final Map<UUID, AdvancementDataPlayer> p;
|
|
|
|
// CraftBukkit end
|
|
|
|
public IPlayerFileData playerFileData;
|
|
|
|
- private boolean hasWhitelist;
|
|
|
|
+ //private boolean hasWhitelist; // Paper - moved to whitelist object so not duplicated
|
|
|
|
protected int maxPlayers;
|
|
|
|
private int s;
|
|
|
|
private EnumGamemode t;
|
|
|
|
@@ -1178,9 +1178,9 @@ public abstract class PlayerList {
|
|
|
|
}
|
|
|
|
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) {
|
|
|
|
@@ -1325,11 +1325,11 @@ public abstract class PlayerList {
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean getHasWhitelist() {
|
|
|
|
- return this.hasWhitelist;
|
|
|
|
+ return this.whitelist.isEnabled(); // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setHasWhitelist(boolean flag) {
|
|
|
|
- this.hasWhitelist = flag;
|
|
|
|
+ this.whitelist.setEnabled(flag); // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<EntityPlayer> b(String s) {
|
|
|
|
--
|
2019-03-20 01:28:15 +01:00
|
|
|
2.21.0
|
2019-03-02 22:23:06 +01:00
|
|
|
|