TheRecovery

spawn

Feb 5th, 2014
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. }
  2. else if (a.equalsIgnoreCase("setspawn")) {
  3. if (p.hasPermission("wh.admin.setspawn")) {
  4. Location loc = p.getLocation();
  5. p.getWorld().setSpawnLocation((int)loc.getX(), (int)loc.getY(), (int)loc.getZ());
  6. settings.getData().set("spawn.world", p.getLocation().getWorld().getName());
  7. settings.getData().set("spawn.x", p.getLocation().getX());
  8. settings.getData().set("spawn.y", p.getLocation().getY());
  9. settings.getData().set("spawn.z", p.getLocation().getZ());
  10. settings.getData().set("spawn.yaw", p.getLocation().getYaw());
  11. settings.getData().set("spawn.Pitch", p.getLocation().getPitch());
  12. settings.saveData();
  13. p.sendMessage(this.prefix + ChatColor.RED + "You have Set the spawn!");
  14.  
  15. }
  16. else if (getConfig().getBoolean("Show-Permission-Message")) {
  17. p.sendMessage(this.perm);
  18. }
  19.  
  20. else if (a.equalsIgnoreCase("spawn")) {
  21. if (getConfig().getBoolean("SpawnCommand")) {
  22. World w = Bukkit.getServer().getWorld(settings.getData().getString("spawn.world"));
  23. double x = settings.getData().getDouble("spawn.x");
  24. double y = settings.getData().getDouble("spawn.y");
  25. double z = settings.getData().getDouble("spawn.z");
  26. //double yaw = settings.getData().getDouble("spawn.yaw");
  27. //double pitch = settings.getData().getDouble("spawn.Pitch");
  28. Location location = new Location(w, x, y, z);
  29. p.teleport(location);
  30. p.sendMessage(this.prefix + ChatColor.RED + "Teleported to spawn");
  31. }
  32. else if (getConfig().getBoolean("Show-Permission-Message")) {
  33. p.sendMessage(this.perm);
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment