Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oq-x committed Nov 17, 2023
1 parent 3f9e183 commit e9788b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core_commands/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var block_cmd = &commands.Command{
},
Execute: func(ctx commands.CommandContext) {
if p, ok := ctx.Executor.(*player.Player); ok {
x, y, z := p.Position()
x, y, z := p.Position.X(), p.Position.Y(), p.Position.Z()
if len(ctx.Arguments) >= 3 {
x, y, z, _ = ctx.GetVector3("pos")
}
Expand Down
12 changes: 6 additions & 6 deletions core_commands/tp.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var tp_cmd = &commands.Command{
return
} else {
player := srv.FindPlayer(ctx.Arguments[0])
x, y, z := player.Position()
yaw, pitch := exe.Rotation()
x, y, z := player.Position.X(), player.Position.Y(), player.Position.Z()
yaw, pitch := exe.Position.Yaw(), exe.Position.Pitch()
exe.Teleport(x, y, z, yaw, pitch)
ep, es := exe.GetPrefixSuffix()
pp, ps := player.GetPrefixSuffix()
Expand All @@ -46,8 +46,8 @@ var tp_cmd = &commands.Command{
// Teleport player to player
player1 := srv.FindPlayer(ctx.Arguments[0])
player2 := srv.FindPlayer(ctx.Arguments[1])
x, y, z := player2.Position()
yaw, pitch := player1.Rotation()
x, y, z := player2.Position.X(), player2.Position.Y(), player2.Position.Z()
yaw, pitch := player1.Position.Yaw(), player1.Position.Yaw()
player1.Teleport(x, y, z, yaw, pitch)

ep, es := player1.GetPrefixSuffix()
Expand Down Expand Up @@ -82,7 +82,7 @@ var tp_cmd = &commands.Command{
ctx.Error("Invalid x position")
return
}
yaw, pitch := exe.Rotation()
yaw, pitch := exe.Position.Yaw(), exe.Position.Pitch()

exe.Teleport(x, y, z, yaw, pitch)

Expand Down Expand Up @@ -118,7 +118,7 @@ var tp_cmd = &commands.Command{
return
}

yaw, pitch := player.Rotation()
yaw, pitch := player.Position.Yaw(), player.Position.Pitch()
player.Teleport(x, y, z, yaw, pitch)

prefix, suffix := player.GetPrefixSuffix()
Expand Down

0 comments on commit e9788b9

Please sign in to comment.