mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
Prevent the Vanish API from sending unnecessary packets.
By: EvilSeph <evilseph@gmail.com>
This commit is contained in:
parent
f59f095728
commit
3f25236f90
1 changed files with 2 additions and 0 deletions
|
@ -564,6 +564,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hidePlayer(Player player) {
|
public void hidePlayer(Player player) {
|
||||||
|
if (hiddenPlayers.contains(player)) return;
|
||||||
hiddenPlayers.add(player);
|
hiddenPlayers.add(player);
|
||||||
|
|
||||||
//remove this player from the hidden player's EntityTrackerEntry
|
//remove this player from the hidden player's EntityTrackerEntry
|
||||||
|
@ -579,6 +580,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showPlayer(Player player) {
|
public void showPlayer(Player player) {
|
||||||
|
if (!hiddenPlayers.contains(player)) return;
|
||||||
hiddenPlayers.remove(player);
|
hiddenPlayers.remove(player);
|
||||||
|
|
||||||
EntityTracker tracker = ((WorldServer) entity.world).tracker;
|
EntityTracker tracker = ((WorldServer) entity.world).tracker;
|
||||||
|
|
Loading…
Reference in a new issue