Skip to content

Commit cf7ee60

Browse files
Teleport to block center instead of corner
1 parent c4a533e commit cf7ee60

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/kotlin/com/github/quiltservertools/ledger/commands/subcommands/TeleportCommand.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ object TeleportCommand : BuildableCommand {
3333
private fun teleport(context: Context, world: ServerWorld, posArg: PosArgument): Int {
3434
val player = context.source.playerOrThrow
3535
val pos = posArg.toAbsoluteBlockPos(context.source)
36+
37+
val x = pos.x.toDouble() + 0.5
38+
val z = pos.z.toDouble() + 0.5
39+
3640
player.teleport(
3741
world,
38-
pos.x.toDouble(),
42+
x,
3943
pos.y.toDouble(),
40-
pos.z.toDouble(),
44+
z,
4145
emptySet(),
4246
player.yaw,
4347
player.pitch,

0 commit comments

Comments
 (0)