Skip to content

Sync vanish state across the network for whispers - #818

Open
ItzStanleex wants to merge 1 commit into
Hexaoxide:trunkfrom
ItzStanleex:fix/cross-server-vanish-whisper
Open

Sync vanish state across the network for whispers#818
ItzStanleex wants to merge 1 commit into
Hexaoxide:trunkfrom
ItzStanleex:fix/cross-server-vanish-whisper

Conversation

@ItzStanleex

Copy link
Copy Markdown

Vanish state was only ever read live from the local platform (Bukkit metadata on Paper), so it was correct only for players on the same server as the viewer. For players on another networked server the resolved CarbonPlayer reported vanished() == false, so vanished players still appeared in /msg (and aliases) tab completion and could be messaged cross-server, ignoring carbon.whisper.vanished.

Vanish state is now carried in the player-presence packets and stored in NetworkUsers, so awareness checks honor it network-wide:

  • LocalPlayerChangePacket / LocalPlayersPacket now carry a vanished flag (new PlayerInfo record as the presence value type).
  • NetworkUsers stores per-player vanish state and exposes awareOf(viewer, other) / vanished(other), which fall back to the synced state for remote players. Whisper suggestions and the whisper send guard use it.
  • Join/quit and the init handshake seed the state; VanishSync polls the abstract CarbonPlayer#vanished() and broadcasts changes, so runtime toggles propagate for any supported vanish plugin (PremiumVanish, SuperVanish, VanishNoPacket, ...) on any platform, with no compile- or runtime dependency on a specific plugin.

Vanish state was only ever read live from the local platform (Bukkit
metadata on Paper), so it was correct only for players on the same
server as the viewer. For players on another networked server the
resolved CarbonPlayer reported vanished() == false, so vanished players
still appeared in /msg (and aliases) tab completion and could be
messaged cross-server, ignoring carbon.whisper.vanished.

Vanish state is now carried in the player-presence packets and stored in
NetworkUsers, so awareness checks honor it network-wide:

- LocalPlayerChangePacket / LocalPlayersPacket now carry a vanished flag
  (new PlayerInfo record as the presence value type).
- NetworkUsers stores per-player vanish state and exposes
  awareOf(viewer, other) / vanished(other), which fall back to the
  synced state for remote players. Whisper suggestions and the whisper
  send guard use it.
- Join/quit and the init handshake seed the state; VanishSync polls the
  abstract CarbonPlayer#vanished() and broadcasts changes, so runtime
  toggles propagate for any supported vanish plugin (PremiumVanish,
  SuperVanish, VanishNoPacket, ...) on any platform, with no compile- or
  runtime dependency on a specific plugin.

This comment was marked as resolved.

@ItzStanleex
ItzStanleex force-pushed the fix/cross-server-vanish-whisper branch 2 times, most recently from d662928 to dfd7d64 Compare August 9, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants