Beispiel #1
0
 /**
  * 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());
   }
 }
Beispiel #2
0
 /**
  * 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());
   }
 }
Beispiel #3
0
 /**
  * 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();
 }