Skip to content

Commit d6bfb72

Browse files
committed
Keep view rotation on tpChunk
1 parent d213e13 commit d6bfb72

File tree

1 file changed

+3
-2
lines changed
  • bukkit/src/main/kotlin/io/github/rothes/esu/bukkit/module/essencialcommands

1 file changed

+3
-2
lines changed

bukkit/src/main/kotlin/io/github/rothes/esu/bukkit/module/essencialcommands/TpChunk.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ object TpChunk : BaseCommand<FeatureToggle.DefaultTrue, Unit>() {
3030
player: Player = (sender as PlayerUser).player,
3131
@Flag("unsafe") unsafe: Boolean = false
3232
) {
33-
val location = Location(world, (chunk.chunkX shl 4) + 8.0, player.y, (chunk.chunkZ shl 4) + 8.0)
34-
val spot = WorldUtils.findStandableSpot(location, unsafe) ?: return sender.message(module.lang, { unsafeTeleportSpot })
33+
val location = player.location
34+
val target = Location(world, (chunk.chunkX shl 4) + 8.0, location.y, (chunk.chunkZ shl 4) + 8.0, location.yaw, location.pitch)
35+
val spot = WorldUtils.findStandableSpot(target, unsafe) ?: return sender.message(module.lang, { unsafeTeleportSpot })
3536
player.tp(spot)
3637
sender.message(module.lang, { teleportingPlayer }, player(player))
3738
}

0 commit comments

Comments
 (0)