Skip to content

Commit 13bdbd0

Browse files
fix problem
1 parent cf7ee60 commit 13bdbd0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import net.minecraft.server.command.CommandManager
1212
import net.minecraft.server.world.ServerWorld
1313

1414
object TeleportCommand : BuildableCommand {
15+
private const val BLOCK_CENTER_OFFSET = 0.5
1516
override fun build(): LiteralNode =
1617
CommandManager.literal("tp")
1718
.requires(Permissions.require("ledger.commands.tp", CommandConsts.PERMISSION_LEVEL))
@@ -34,8 +35,8 @@ object TeleportCommand : BuildableCommand {
3435
val player = context.source.playerOrThrow
3536
val pos = posArg.toAbsoluteBlockPos(context.source)
3637

37-
val x = pos.x.toDouble() + 0.5
38-
val z = pos.z.toDouble() + 0.5
38+
val x = pos.x.toDouble() + BLOCK_CENTER_OFFSET
39+
val z = pos.z.toDouble() + BLOCK_CENTER_OFFSET
3940

4041
player.teleport(
4142
world,

0 commit comments

Comments
 (0)