diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-03-16 05:14:11 -0700 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-03-16 05:14:11 -0700 |
commit | 2711bdacf42d72b128b5bc5ab4c4bdec1d97b3f3 (patch) | |
tree | 2a4316ad19db37279e64aff98b77b4c4464f3ad8 | |
parent | e5b26fc061c8723dd47e5415c919d78bcd9988d2 (diff) | |
parent | 7901f6e9b9cf630cb54f1b58baf596a106af4ec8 (diff) | |
download | Essentials-2711bdacf42d72b128b5bc5ab4c4bdec1d97b3f3.tar Essentials-2711bdacf42d72b128b5bc5ab4c4bdec1d97b3f3.tar.gz Essentials-2711bdacf42d72b128b5bc5ab4c4bdec1d97b3f3.tar.lz Essentials-2711bdacf42d72b128b5bc5ab4c4bdec1d97b3f3.tar.xz Essentials-2711bdacf42d72b128b5bc5ab4c4bdec1d97b3f3.zip |
Merge pull request #386 from gmfreaky/patch-1
Keep player orientation when teleporting
-rw-r--r-- | Essentials/src/net/ess3/commands/Commandtppos.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Essentials/src/net/ess3/commands/Commandtppos.java b/Essentials/src/net/ess3/commands/Commandtppos.java index 13b4d7052..042b6ce05 100644 --- a/Essentials/src/net/ess3/commands/Commandtppos.java +++ b/Essentials/src/net/ess3/commands/Commandtppos.java @@ -21,7 +21,8 @@ public class Commandtppos extends EssentialsCommand final int x = Integer.parseInt(args[0]); final int y = Integer.parseInt(args[1]); final int z = Integer.parseInt(args[2]); - final Location location = new Location(user.getPlayer().getWorld(), x, y, z); + final Location playerLocation = user.getPlayer().getLocation(); + final Location location = new Location(user.getPlayer().getWorld(), x, y, z, playerLocation.getYaw(), playerLocation.getPitch()); if (args.length > 3) { location.setYaw((Float.parseFloat(args[3]) + 180 + 360) % 360); @@ -53,7 +54,8 @@ public class Commandtppos extends EssentialsCommand final int x = Integer.parseInt(args[1]); final int y = Integer.parseInt(args[2]); final int z = Integer.parseInt(args[3]); - final Location location = new Location(user.getPlayer().getWorld(), x, y, z); + final Location playerLocation = user.getPlayer().getLocation(); + final Location location = new Location(user.getPlayer().getWorld(), x, y, z, playerLocation.getYaw(), playerLocation.getPitch()); if (args.length > 4) { location.setYaw((Float.parseFloat(args[4]) + 180 + 360) % 360); @@ -70,4 +72,4 @@ public class Commandtppos extends EssentialsCommand user.sendMessage(_("teleporting")); user.getTeleport().teleport(location, null, TeleportCause.COMMAND); } -}
\ No newline at end of file +} |