Skip to content

Commit

Permalink
🐛 fix spectator mode
Browse files Browse the repository at this point in the history
  • Loading branch information
XiYang6666 committed Aug 9, 2024
1 parent 21d8c6b commit 847c465
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/kotlin/xyz/xasmc/hashbook/listener/MarkListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ class MarkListener : Listener {
@EventHandler
fun onPlayerMove(event: PlayerMoveEvent) {
val player = event.player
if (player.gameMode == GameMode.SPECTATOR) return
if (player.gameMode == GameMode.SPECTATOR) {
MarkUtil.removeMark(player)
return
}
val direction = player.eyeLocation.direction
val maxDistance = 5.0
val result = player.world.rayTraceBlocks(player.eyeLocation, direction, maxDistance)
Expand Down

0 comments on commit 847c465

Please sign in to comment.