SyntaxWolf
Redstoneengineer
Hallo,
ich habe ein Problem mit den Locations in der Config. Das Problem ist, dass man nicht teleportiert wird.
ich habe ein Problem mit den Locations in der Config. Das Problem ist, dass man nicht teleportiert wird.
Code:
public static void createLocation(Player p, String name) {
Location location = p.getLocation();
locationsConfiguration.set("locations.lobby." + name + ".World", location.getWorld().getName());
locationsConfiguration.set("locations.lobby." + name + ".X", Double.valueOf(location.getX()));
locationsConfiguration.set("locations.lobby." + name + ".Y", Double.valueOf(location.getY()));
locationsConfiguration.set("locations.lobby." + name + ".Z", Double.valueOf(location.getZ()));
locationsConfiguration.set("locations.lobby." + name + ".Yaw", Float.valueOf(location.getYaw()));
locationsConfiguration.set("locations.lobby." + name + ".Pich", Float.valueOf(location.getPitch()));
try {
locationsConfiguration.save(locationsFile);
} catch (IOException ex) {
ex.printStackTrace();
}
}
public static Location getLocation(String name) {
World w = Bukkit.getWorld(locationsConfiguration.getString("locations.lobby" + name + ".World"));
double x = locationsConfiguration.getDouble("locations.lobby." + "locations.lobby" + name + ".X");
double y = locationsConfiguration.getDouble("locations.lobby." + name + ".Y");
double z = locationsConfiguration.getDouble("locations.lobby." + name + ".Z");
float yaw = (float) locationsConfiguration.getDouble("locations.lobby." + name + ".Yaw");
float pitch = (float) locationsConfiguration.getDouble("locations.lobby." + name + ".Pitch");
return new Location(w, x, y, z, yaw, pitch);
}