/** * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ package tntrun.lobby; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.util.Vector; public class LobbyLocation { private String worldname; protected String getWorldName() { return worldname; } private double x; private double y; private double z; protected Vector getVector() { return new Vector(x, y, z); } private float yaw; protected float getYaw() { return yaw; } private float pitch; protected float getPitch() { return pitch; } public LobbyLocation(String worldname, Vector vector, float yaw, float pitch) { this.worldname = worldname; x = vector.getX(); y = vector.getY(); z = vector.getZ(); this.yaw = yaw; this.pitch = pitch; } protected boolean isWorldAvailable() { return Bukkit.getWorld(worldname) != null; } protected Location getLocation() { if (isWorldAvailable()) { return new Location(Bukkit.getWorld(worldname), x, y, z, yaw, pitch); } return null; } }