Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. @Override
  2. public boolean onCommand(CommandSender sender, Command command, String commandLabel, String args[]) {
  3. if (sender instanceof Player) {
  4. Player p = (Player) sender;
  5. String uuid = p.getUniqueId().toString();
  6. if (Util.getPlugin().getConfig().contains("uuid.world")) {
  7. World w = Bukkit.getServer().getWorld(Util.getPlugin().getConfig().getString("uuid.world"));
  8. double x = Util.getPlugin().getConfig().getDouble("uuid.x");
  9. double y = Util.getPlugin().getConfig().getDouble("uuid.y");
  10. double z = Util.getPlugin().getConfig().getDouble("uuid.z");
  11. double yaw = Util.getPlugin().getConfig().getDouble("uuid.yaw");
  12. double pitch = Util.getPlugin().getConfig().getDouble("uuid.pitch");
  13. p.teleport(new Location(w, x, y, z, (float) yaw, (float) pitch));
  14. p.sendMessage(Msg.cPrefix + "You have been teleported to your home.");
  15. } else {
  16. p.sendMessage(Msg.cPrefix + "You have not set your home yet.");
  17. p.sendMessage(Msg.cPrefix + "You can set your home by using the /sethome command!");
  18. }
  19. }
  20. return false;
  21. }
  22.  
  23. @Override
  24. public boolean onCommand(CommandSender sender, Command command, String commandLabel, String args[]) {
  25. if (sender instanceof Player) {
  26. Player p = (Player) sender;
  27. String uuid = p.getUniqueId().toString();
  28. Util.getPlugin().getConfig().set("uuid.world", p.getLocation().getWorld().getName());
  29. Util.getPlugin().getConfig().set("uuid.x", p.getLocation().getX());
  30. Util.getPlugin().getConfig().set("uuid.y", p.getLocation().getY());
  31. Util.getPlugin().getConfig().set("uuid.z", p.getLocation().getZ());
  32. Util.getPlugin().getConfig().set("uuid.pitch", p.getEyeLocation().getPitch());
  33. Util.getPlugin().getConfig().set("uuid.yaw", p.getEyeLocation().getYaw());
  34. Util.getPlugin().saveConfig();
  35. p.sendMessage(Msg.cPrefix + "Your home has been set.");
  36. }
  37. return false;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement