summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunfighterJ <joseph.jenniges@gmail.com>2013-02-22 10:56:39 -0600
committerGunfighterJ <joseph.jenniges@gmail.com>2013-02-22 10:56:39 -0600
commita61e905f9aaa45c81c46d853ec6cb566acd087a7 (patch)
tree866527aa3acebb24ceffc72933e350cd31c23ef2
parent42e934eeb25e71094ed4ece5cb6f24159e51d41b (diff)
downloadEssentials-a61e905f9aaa45c81c46d853ec6cb566acd087a7.tar
Essentials-a61e905f9aaa45c81c46d853ec6cb566acd087a7.tar.gz
Essentials-a61e905f9aaa45c81c46d853ec6cb566acd087a7.tar.lz
Essentials-a61e905f9aaa45c81c46d853ec6cb566acd087a7.tar.xz
Essentials-a61e905f9aaa45c81c46d853ec6cb566acd087a7.zip
[Fix] Persist yaw and pitch on teleport
Vanilla bukkit/MC persists yaw on teleport
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtp.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtppos.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
index 7eae137a3..efaf32f65 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
@@ -54,7 +54,7 @@ public class Commandtp extends EssentialsCommand
{
throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //TODO: I18n
}
- final Location location = new Location(target2.getWorld(), x, y, z);
+ final Location location = new Location(target2.getWorld(), x, y, z, target2.getLocation().getYaw(), target2.getLocation().getPitch());
if (!target2.isTeleportEnabled())
{
throw new Exception(_("teleportDisabled", target2.getDisplayName()));
@@ -115,7 +115,7 @@ public class Commandtp extends EssentialsCommand
{
throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //TODO: I18n
}
- final Location location = new Location(target.getWorld(), x, y, z);
+ final Location location = new Location(target.getWorld(), x, y, z, target.getLocation().getYaw(), target.getLocation().getPitch());
target.getTeleport().now(location, false, TeleportCause.COMMAND);
target.sendMessage(_("teleporting"));
} else {
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
index c03a8b435..6f7789208 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
@@ -27,7 +27,7 @@ public class Commandtppos extends EssentialsCommand
final double x = args[0].startsWith("~") ? user.getLocation().getX() + Integer.parseInt(args[0].substring(1)) : Integer.parseInt(args[0]);
final double y = args[1].startsWith("~") ? user.getLocation().getY() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]);
final double z = args[2].startsWith("~") ? user.getLocation().getZ() + Integer.parseInt(args[2].substring(1)) : Integer.parseInt(args[2]);
- final Location location = new Location(user.getWorld(), x, y, z);
+ final Location location = new Location(user.getWorld(), x, y, z, user.getLocation().getYaw(), user.getLocation().getPitch());
if (args.length > 3)
{
location.setYaw((Float.parseFloat(args[3]) + 180 + 360) % 360);
@@ -59,7 +59,7 @@ public class Commandtppos extends EssentialsCommand
final double x = args[1].startsWith("~") ? user.getLocation().getX() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]);
final double y = args[2].startsWith("~") ? user.getLocation().getY() + Integer.parseInt(args[2].substring(1)) : Integer.parseInt(args[2]);
final double z = args[3].startsWith("~") ? user.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]);
- final Location location = new Location(user.getWorld(), x, y, z);
+ final Location location = new Location(user.getWorld(), x, y, z, user.getLocation().getYaw(), user.getLocation().getPitch());
if (args.length > 4)
{
location.setYaw((Float.parseFloat(args[4]) + 180 + 360) % 360);