In WorldGuard, teleport/spawn location yaw/pitch should now work.

This commit is contained in:
TomyLobo 2012-03-12 16:40:02 +01:00
parent b8e9f6bb77
commit 85cdd49593

View File

@ -28,7 +28,13 @@ import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.World; 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 { public class BukkitUtil {
private BukkitUtil() { private BukkitUtil() {
@ -122,8 +128,12 @@ public class BukkitUtil {
public static final double EQUALS_PRECISION = 0.0001; public static final double EQUALS_PRECISION = 0.0001;
public static org.bukkit.Location toLocation(Location teleportLocation) { public static org.bukkit.Location toLocation(Location teleportLocation) {
final LocalWorld world = teleportLocation.getWorld(); Vector pt = teleportLocation.getPosition();
return toLocation(toWorld(world), 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) { public static World toWorld(final LocalWorld world) {