3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-22 06:20:06 +01:00
Paper/patches/server/0310-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch

37 Zeilen
2.3 KiB
Diff

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 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/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
2021-06-13 11:41:07 +02:00
index 0df68991eb2ef3dabe779f42c2bf44846ac0d862..4ae234a107d16bc71425af5f2729c428f79e3db7 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
2021-06-13 11:41:07 +02:00
@@ -62,6 +62,7 @@ import net.minecraft.network.protocol.game.ClientboundUpdateMobEffectPacket;
2021-06-11 14:02:28 +02:00
import net.minecraft.network.protocol.game.ClientboundUpdateRecipesPacket;
import net.minecraft.network.protocol.game.ClientboundUpdateTagsPacket;
import net.minecraft.resources.ResourceKey;
+import net.minecraft.server.MCUtil;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PlayerAdvancements;
import net.minecraft.server.ServerScoreboard;
2021-06-13 11:41:07 +02:00
@@ -996,9 +997,9 @@ public abstract class PlayerList {
2021-06-11 14:02:28 +02:00
}
public boolean isWhitelisted(GameProfile gameprofile, org.bukkit.event.player.PlayerLoginEvent loginEvent) {
boolean isOp = this.ops.contains(gameprofile);
- boolean isWhitelisted = !this.doWhiteList || isOp || this.whitelist.contains(gameprofile);
2021-06-13 11:41:07 +02:00
+ boolean isWhitelisted = !this.isUsingWhitelist() || isOp || this.whitelist.contains(gameprofile); // Paper - use isUsingWhitelist()
2021-06-11 14:02:28 +02:00
final com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent event;
2021-06-13 11:41:07 +02:00
- event = new com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent(net.minecraft.server.MCUtil.toBukkit(gameprofile), this.doWhiteList, isWhitelisted, isOp, org.spigotmc.SpigotConfig.whitelistMessage);
+ event = new com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent(net.minecraft.server.MCUtil.toBukkit(gameprofile), this.isUsingWhitelist(), isWhitelisted, isOp, org.spigotmc.SpigotConfig.whitelistMessage); // Paper - use isUsingWhitelist()
2021-06-11 14:02:28 +02:00
event.callEvent();
if (!event.isWhitelisted()) {
if (loginEvent != null) {