2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2019-03-02 21:23:06 +00: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
|
2020-05-06 09:48:49 +00:00
|
|
|
index 8570e38f42e2f489e2899ac2f0c4a7b8dda3bb75..c97be42dd7b4c6ea2cadcc97f47185c7f02e2cce 100644
|
2019-03-02 21:23:06 +00: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;
|
|
|
|
}
|
|
|
|
|
2019-05-05 17:19:34 +00:00
|
|
|
+ public void setEnabled(boolean flag) { this.a(flag); } // Paper - OBFHeLPER
|
2019-03-02 21:23:06 +00:00
|
|
|
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
|
2020-05-12 05:27:03 +00:00
|
|
|
index 14c82861158eed8c91336590fb71c69d185d22f8..299a6586ddfdc221be93e2f3d55801ac06bf783b 100644
|
2019-03-02 21:23:06 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
2019-05-05 17:19:34 +00:00
|
|
|
@@ -62,7 +62,7 @@ public abstract class PlayerList {
|
2019-03-02 21:23:06 +00:00
|
|
|
// private final Map<UUID, AdvancementDataPlayer> p;
|
|
|
|
// CraftBukkit end
|
|
|
|
public IPlayerFileData playerFileData;
|
|
|
|
- private boolean hasWhitelist;
|
2019-05-05 17:19:34 +00:00
|
|
|
+ //private boolean hasWhitelist;
|
|
|
|
protected final int maxPlayers;
|
2019-05-14 02:20:58 +00:00
|
|
|
private int viewDistance;
|
2019-03-02 21:23:06 +00:00
|
|
|
private EnumGamemode t;
|
2020-05-06 09:22:03 +00:00
|
|
|
@@ -889,9 +889,9 @@ public abstract class PlayerList {
|
2019-03-02 21:23:06 +00: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) {
|
2020-05-12 05:27:03 +00:00
|
|
|
@@ -1022,11 +1022,11 @@ public abstract class PlayerList {
|
2019-03-02 21:23:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|