/** * Delete a home that belongs to a player * * @param playername The palyer * @param home The name of the home * @throws CommandException if user is null or no home with this name */ public void deleteHome(String playername, String home) throws CommandException { User u = getEssentialsUser(playername); try { u.delHome(home); } catch (Exception e) { throw new HomeException(home, u.getHomes()); } }
/** * Get the location of a home of a Player * * @param playername The Player * @param home The name of the home * @return The location of the home * @throws CommandException if user is null or no home with this name */ public Location getHome(String playername, String home) throws CommandException { User u = getEssentialsUser(playername); try { Location loc = u.getHome(home); if (loc == null) { throw new HomeException(home, u.getHomes()); } return loc; } catch (Exception e) { throw new CommandException(e.getMessage()); } }
/** * Get all homes of a player * * @param playername The player * @return The list of homes * @throws CommandException if User is null */ public List<String> getHomes(String playername) throws CommandException { User u = getEssentialsUser(playername); return u.getHomes(); }