mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-24 18:07:39 +01:00
Fixed potential packet loss issue with vanish API. Fixes BUKKIT-1125
This commit is contained in:
parent
bdd2139c78
commit
49ff166d15
@ -599,6 +599,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
public void hidePlayer(Player player) {
|
||||
Validate.notNull(player, "hidden player cannot be null");
|
||||
if (equals(player)) return;
|
||||
if (hiddenPlayers.containsKey(player.getName())) return;
|
||||
hiddenPlayers.put(player.getName(), player);
|
||||
|
||||
@ -615,6 +617,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
public void showPlayer(Player player) {
|
||||
Validate.notNull(player, "shown player cannot be null");
|
||||
if (equals(player)) return;
|
||||
if (!hiddenPlayers.containsKey(player.getName())) return;
|
||||
hiddenPlayers.remove(player.getName());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user