Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean onCommand(CommandSender sender, Command command, String commandLabel, String args[]) {
- if (sender instanceof Player) {
- Player p = (Player) sender;
- String uuid = p.getUniqueId().toString();
- if (Util.getPlugin().getConfig().contains("uuid.world")) {
- World w = Bukkit.getServer().getWorld(Util.getPlugin().getConfig().getString("uuid.world"));
- double x = Util.getPlugin().getConfig().getDouble("uuid.x");
- double y = Util.getPlugin().getConfig().getDouble("uuid.y");
- double z = Util.getPlugin().getConfig().getDouble("uuid.z");
- double yaw = Util.getPlugin().getConfig().getDouble("uuid.yaw");
- double pitch = Util.getPlugin().getConfig().getDouble("uuid.pitch");
- p.teleport(new Location(w, x, y, z, (float) yaw, (float) pitch));
- p.sendMessage(Msg.cPrefix + "You have been teleported to your home.");
- } else {
- p.sendMessage(Msg.cPrefix + "You have not set your home yet.");
- p.sendMessage(Msg.cPrefix + "You can set your home by using the /sethome command!");
- }
- }
- return false;
- }
- @Override
- public boolean onCommand(CommandSender sender, Command command, String commandLabel, String args[]) {
- if (sender instanceof Player) {
- Player p = (Player) sender;
- String uuid = p.getUniqueId().toString();
- Util.getPlugin().getConfig().set("uuid.world", p.getLocation().getWorld().getName());
- Util.getPlugin().getConfig().set("uuid.x", p.getLocation().getX());
- Util.getPlugin().getConfig().set("uuid.y", p.getLocation().getY());
- Util.getPlugin().getConfig().set("uuid.z", p.getLocation().getZ());
- Util.getPlugin().getConfig().set("uuid.pitch", p.getEyeLocation().getPitch());
- Util.getPlugin().getConfig().set("uuid.yaw", p.getEyeLocation().getYaw());
- Util.getPlugin().saveConfig();
- p.sendMessage(Msg.cPrefix + "Your home has been set.");
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement