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 d1862ea commit 21d8c6b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/kotlin/xyz/xasmc/hashbook/listener/MarkListener.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.xasmc.hashbook.listener

import org.bukkit.GameMode
import org.bukkit.Material
import org.bukkit.block.Block
import org.bukkit.block.ChiseledBookshelf
Expand All @@ -20,6 +21,7 @@ class MarkListener : Listener {
@EventHandler
fun onPlayerMove(event: PlayerMoveEvent) {
val player = event.player
if (player.gameMode == GameMode.SPECTATOR) 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 21d8c6b

Please sign in to comment.