Skip to content

Commit

Permalink
fix: apply remember option correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Syrent committed Apr 28, 2024
1 parent 60adcd2 commit bddb3d9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ class PlayerJoinListener(
// Note: DiscordSRV support
player.setMetadata("vanished", FixedMetadataValue(plugin, true))

if (!Settings.remember) return

for (vanishedPlayer in plugin.vanishedNames.mapNotNull { Bukkit.getPlayerExact(it) }) {
plugin.vanishManager.hidePlayer(vanishedPlayer)
plugin.vanishManager.updateTabState(vanishedPlayer, GameMode.SPECTATOR)
Expand All @@ -46,13 +44,15 @@ class PlayerJoinListener(
}

if (plugin.vanishedNames.contains(player.name)) {
if (!Settings.remember) return
plugin.vanishManager.vanish(player, sendQuitMessage = false, callPostEvent = true)
event.joinMessage = null
} else {
if (player.hasPermission("velocityvanish.action.vanish.onjoin")) {
plugin.vanishManager.vanish(player, sendQuitMessage = false, callPostEvent = true)
event.joinMessage = null
} else if (player.hasPermission("velocityvanish.action.vanish.force") && Settings.forceVanishIfFirst && Ruom.onlinePlayers.size <= 1) {
if (!Settings.remember) return
player.sendMessage(Message.FORCE_VANISHED)
plugin.vanishManager.vanish(player, sendQuitMessage = false, callPostEvent = true)
event.joinMessage = null
Expand Down

0 comments on commit bddb3d9

Please sign in to comment.