mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 20:21:51 +01:00
e4d10a6d67
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 122289ff Add FaceAttachable interface to handle Grindstone facing in common with Switches a6db750e SPIGOT-5647: ZombieVillager entity should have getVillagerType() CraftBukkit Changes:bbe3d58e
SPIGOT-5650: Lectern.setPage(int) causes a NullPointerException3075579f
Add FaceAttachable interface to handle Grindstone facing in common with Switches95bd4238
SPIGOT-5647: ZombieVillager entity should have getVillagerType()4d975ac3
SPIGOT-5617: setBlockData does not work when NotPlayEvent is called by redstone current
66 lines
2.9 KiB
Diff
66 lines
2.9 KiB
Diff
From 4158af0b55c5eb77140471ab1226affbceab7e34 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 8570e38f42..c97be42dd7 100644
|
|
--- 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) { this.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
|
|
index 659ce21818..62d8075971 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
|
@@ -62,7 +62,7 @@ public abstract class PlayerList {
|
|
// private final Map<UUID, AdvancementDataPlayer> p;
|
|
// CraftBukkit end
|
|
public IPlayerFileData playerFileData;
|
|
- private boolean hasWhitelist;
|
|
+ //private boolean hasWhitelist;
|
|
protected final int maxPlayers;
|
|
private int viewDistance;
|
|
private EnumGamemode t;
|
|
@@ -900,9 +900,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) {
|
|
@@ -1031,11 +1031,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) {
|
|
--
|
|
2.25.1
|
|
|