Exemplo n.º 1
0
  public void addExplorationSign(Player player, CommandSign sign, Location location)
      throws ExplorersException {
    final String token = sign.getRouteName();
    final String name = player.getName();

    Route r = getOrCreateRoute(token, name);
    if (!r.isOwner(player) && !player.hasPermission(CREATE_PERMISSION)) {
      throw new ExplorersPermissionException();
    }

    signs.add(locationToArray(location));
    player.sendMessage(SIGN_CREATED_MSG);
    saveState();
  }
Exemplo n.º 2
0
 /**
  * Called when a player activates a command sign.
  *
  * @param player The player who activated the sign
  * @param signType The command on the sign
  * @param token The route on the sign
  * @throws ExplorersException
  */
 public void activateSign(final Player player, final CommandSign sign) throws ExplorersException {
   switch (sign.getSignType()) {
     case FINISH_SIGN:
       activateFinishSign(player, sign.getRouteName(), sign.getWaypoint());
       break;
     case START_SIGN:
       activateStartSign(player, sign.getRouteName());
       break;
     case VIEW_SIGN:
       activateViewSign(player, sign.getRouteName());
       break;
     case WAYPOINTS_SIGN:
       activateWaypointSign(player, sign.getRouteName(), sign.getWaypoint());
       break;
     case LOCK_SIGN:
       activateLockSign(player, sign.getRouteName());
       break;
     case ENROUTE_SIGN:
       activateEnrouteSign(player, sign.getRouteName());
       break;
   }
 }