Skip to content

Commit

Permalink
chore: add gamemode check for canFly on unvanish
Browse files Browse the repository at this point in the history
  • Loading branch information
Syrent committed Feb 12, 2024
1 parent 8d26207 commit 5abc2e8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class VanishManager(
flyingPlayers.add(player.uniqueId)
}

if (player.hasPermission("velocityvanish.action.fly.onvanish") || player.isOp || player.allowFlight) {
if (player.hasPermission("velocityvanish.action.fly.onvanish") || player.allowFlight) {
player.allowFlight = true
player.isFlying = true
}
Expand Down Expand Up @@ -300,7 +300,7 @@ class VanishManager(

updateTabState(player, GameMode.SURVIVAL)

val canFly = player.isOp || player.gameMode == GameMode.CREATIVE || flyingPlayers.contains(player.uniqueId)
val canFly = player.isOp || player.gameMode == GameMode.CREATIVE || flyingPlayers.contains(player.uniqueId) || player.gameMode == GameMode.SPECTATOR || player.gameMode == GameMode.CREATIVE
player.allowFlight = canFly
player.isFlying = canFly
flyingPlayers.remove(player.uniqueId)
Expand All @@ -310,8 +310,8 @@ class VanishManager(
}

for (onlinePlayer in Ruom.onlinePlayers) {
@Suppress("DEPRECATION")
onlinePlayer.showPlayer(player)
@Suppress("DEPRECATION")
onlinePlayer.showPlayer(player)
}

player.isSleepingIgnored = false
Expand Down

0 comments on commit 5abc2e8

Please sign in to comment.