mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 09:16:06 +01:00
Fixed potential packet loss issue with vanish API. Fixes BUKKIT-1125
By: Kevin Ingersoll <kingersoll@gmail.com>
This commit is contained in:
parent
023ce58427
commit
eaf42d8b35
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue