File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/kotlin/com/github/quiltservertools/ledger/commands/subcommands Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import net.minecraft.server.command.CommandManager
1212import net.minecraft.server.world.ServerWorld
1313
1414object 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,
You can’t perform that action at this time.
0 commit comments