2011-06-18 03:55:26 -04:00
|
|
|
package com.cypherx.xauth;
|
|
|
|
|
2011-07-29 17:29:51 -04:00
|
|
|
import java.util.UUID;
|
|
|
|
|
2011-06-18 03:55:26 -04:00
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.Location;
|
|
|
|
import org.bukkit.World;
|
|
|
|
|
|
|
|
public class TeleLocation {
|
2011-07-29 17:29:51 -04:00
|
|
|
private UUID uid;
|
2011-06-18 03:55:26 -04:00
|
|
|
private double x;
|
|
|
|
private double y;
|
|
|
|
private double z;
|
|
|
|
private float yaw;
|
|
|
|
private float pitch;
|
2011-07-29 17:29:51 -04:00
|
|
|
private int global;
|
2011-06-18 03:55:26 -04:00
|
|
|
|
|
|
|
public TeleLocation() {}
|
|
|
|
|
2011-07-29 17:29:51 -04:00
|
|
|
public TeleLocation(Location location, boolean global) {
|
|
|
|
World world = location.getWorld();
|
|
|
|
uid = world.getUID();
|
2011-06-18 03:55:26 -04:00
|
|
|
x = location.getX();
|
|
|
|
y = location.getY();
|
|
|
|
z = location.getZ();
|
|
|
|
yaw = location.getYaw();
|
|
|
|
pitch = location.getPitch();
|
2011-07-29 17:29:51 -04:00
|
|
|
this.global = (global ? 1 : 0);
|
2011-06-18 03:55:26 -04:00
|
|
|
}
|
|
|
|
|
2011-07-29 17:29:51 -04:00
|
|
|
public void setUID(UUID uid) {
|
|
|
|
this.uid = uid;
|
2011-06-18 03:55:26 -04:00
|
|
|
}
|
|
|
|
|
2011-07-29 17:29:51 -04:00
|
|
|
public UUID getUID() {
|
|
|
|
return uid;
|
2011-06-18 03:55:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setX(double x) {
|
|
|
|
this.x = x;
|
|
|
|
}
|
|
|
|
|
|
|
|
public double getX() {
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setY(double y) {
|
|
|
|
this.y = y;
|
|
|
|
}
|
|
|
|
|
|
|
|
public double getY() {
|
|
|
|
return y;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setZ(double z) {
|
|
|
|
this.z = z;
|
|
|
|
}
|
|
|
|
|
|
|
|
public double getZ() {
|
|
|
|
return z;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setYaw(float yaw) {
|
|
|
|
this.yaw = yaw;
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getYaw() {
|
|
|
|
return yaw;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setPitch(float pitch) {
|
|
|
|
this.pitch = pitch;
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getPitch() {
|
|
|
|
return pitch;
|
|
|
|
}
|
|
|
|
|
2011-07-29 17:29:51 -04:00
|
|
|
public void setGlobal(int global) {
|
|
|
|
this.global = global;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getGlobal() {
|
|
|
|
return global;
|
|
|
|
}
|
|
|
|
|
2011-06-18 03:55:26 -04:00
|
|
|
public void setLocation(Location location) {
|
|
|
|
this.x = location.getX();
|
|
|
|
this.y = location.getY();
|
|
|
|
this.z = location.getZ();
|
|
|
|
this.yaw = location.getYaw();
|
|
|
|
this.pitch = location.getPitch();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Location getLocation() {
|
2011-07-29 17:29:51 -04:00
|
|
|
World world = Bukkit.getServer().getWorld(uid);
|
2011-06-18 03:55:26 -04:00
|
|
|
return new Location(world, x, y, z, yaw, pitch);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|