File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/main/kotlin/dev/slne/surf/lobby/listener Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package dev.slne.surf.lobby.listener
33import dev.slne.surf.surfapi.bukkit.api.event.cancel
44import org.bukkit.GameMode
55import org.bukkit.Particle
6- import org.bukkit.block.BlockFace
76import org.bukkit.event.EventHandler
87import org.bukkit.event.Listener
98import org.bukkit.event.player.PlayerMoveEvent
@@ -15,7 +14,11 @@ object DoubleJumpListener : Listener {
1514 if (! event.hasExplicitlyChangedBlock()) return
1615 val player = event.getPlayer()
1716
18- if (player.gameMode != GameMode .CREATIVE && player.location.block.getRelative(BlockFace .DOWN ).isEmpty && ! player.isFlying) {
17+
18+ if (player.gameMode != GameMode .CREATIVE &&
19+ player.isOnGround &&
20+ ! player.isFlying
21+ ) {
1922 player.allowFlight = true
2023 }
2124 }
@@ -28,6 +31,10 @@ object DoubleJumpListener : Listener {
2831 return
2932 }
3033
34+ if (! player.allowFlight) {
35+ return
36+ }
37+
3138 val direction = player.eyeLocation.direction
3239 val loc = player.location
3340
You can’t perform that action at this time.
0 commit comments