@Override public void onAction(final Player player,final RPAction action){
  rewriteCommandLine(action);
  String actionStr=action.get("action");
  if (actionStr == null) {
    logger.warn("missing action attribute in RPAction " + action);
    return;
  }
  if (actionStr.equals("offer_trade")) {
    Entity entity=EntityHelper.entityFromTargetName(action.get("target"),player);
    if ((entity == null) || (!(entity instanceof Player))) {
      return;
    }
    player.offerTrade((Player)entity);
  }
 else   if (actionStr.equals("lock")) {
    player.lockTrade();
  }
 else   if (actionStr.equals("unlock")) {
    player.unlockTradeItemOffer();
  }
 else   if (actionStr.equals("deal")) {
    player.dealTrade();
  }
 else   if (actionStr.equals("cancel")) {
    player.cancelTrade();
  }
}

@ Override public void onAction ( final Player player , final RPAction action ) { rewriteCommandLine ( action ) ; String actionStr = action . get ( "action" ) ; if ( actionStr == null ) { logger . warn ( "missing action attribute in RPAction " + action ) ; return ; } if ( actionStr . equals ( "offer_trade" ) ) { Entity entity = EntityHelper . entityFromTargetName ( action . get ( "target" ) , player ) ; if ( ( entity == null ) || ( ! ( entity instanceof Player ) ) ) { return ; } player . offerTrade ( ( Player ) entity ) ; } else if ( actionStr . equals ( "lock" ) ) { player . lockTrade ( ) ; } else if ( actionStr . equals ( "unlock" ) ) { player . unlockTradeItemOffer ( ) ; } else if ( actionStr . equals ( "deal" ) ) { player . dealTrade ( ) ; } else if ( actionStr . equals ( "cancel" ) ) { player . cancelTrade ( ) ; } }
processes the requested action .
