From 85cdd49593a95a1ebc072ba0b08a724d0285a013 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Mon, 12 Mar 2012 16:40:02 +0100 Subject: [PATCH] In WorldGuard, teleport/spawn location yaw/pitch should now work. --- .../com/sk89q/worldedit/bukkit/BukkitUtil.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java b/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java index 12e1dbc8f..23ad11974 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/BukkitUtil.java @@ -28,7 +28,13 @@ import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.Server; import org.bukkit.World; -import com.sk89q.worldedit.*; + +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockWorldVector; +import com.sk89q.worldedit.LocalWorld; +import com.sk89q.worldedit.Location; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldVector; public class BukkitUtil { private BukkitUtil() { @@ -122,8 +128,12 @@ public class BukkitUtil { public static final double EQUALS_PRECISION = 0.0001; public static org.bukkit.Location toLocation(Location teleportLocation) { - final LocalWorld world = teleportLocation.getWorld(); - return toLocation(toWorld(world), teleportLocation.getPosition()); + Vector pt = teleportLocation.getPosition(); + return new org.bukkit.Location( + toWorld(teleportLocation.getWorld()), + pt.getX(), pt.getY(), pt.getZ(), + teleportLocation.getYaw(), teleportLocation.getPitch() + ); } public static World toWorld(final LocalWorld world) {