Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void setSpawn(Player p) {
- if (p.hasPermission("Skypvp.admin")) {
- String path = "SpawnLocation.spawn";
- Location loc = p.getLocation();
- String world = loc.getWorld().getName();
- double x = loc.getX();
- double y = loc.getY();
- double z = loc.getZ();
- double yaw = loc.getYaw();
- double pitch = loc.getPitch();
- FileConfiguration cfg = main.getConfig();
- cfg.set(path + ".World", world);
- cfg.set(path + ".PosX", Double.valueOf(x));
- cfg.set(path + ".PosY", Double.valueOf(y));
- cfg.set(path + ".PosZ", Double.valueOf(z));
- cfg.set(path + ".PosYaw", Double.valueOf(yaw));
- cfg.set(path + ".PosPitch", Double.valueOf(pitch));
- main.saveConfig();
- p.sendMessage(Main.Prefix + "§6§lDu hast den SkyPvP Welt Spawn gesetzt!");
- } else {
- p.sendMessage(Main.Prefix + "§c§lDu hast keine Berechtigung dazu!");
- }
- }
- public static void tpSpawn(Player p) {
- FileConfiguration cfg = main.getConfig();
- String path = "SpawnLocation.spawn";
- if (cfg.contains(path)) {
- double x = cfg.getDouble(path + ".PosX");
- double y = cfg.getDouble(path + ".PosY");
- double z = cfg.getDouble(path + ".PosZ");
- double yaw = cfg.getDouble(path + ".PosYaw");
- double pitch = cfg.getDouble(path + ".PosPitch");
- String world = cfg.getString(path + ".World");
- Location loc = new Location(Bukkit.getWorld(world), x, y, z, (float)yaw, (float)pitch);
- p.teleport(loc);
- }
- else {
- p.sendMessage(Main.Prefix + "§7§lEs wurde noch kein Spawn Punkt gesetzt.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement