public static boolean execute(final RPObject caster,final RPAction action){
  try {
    if (caster instanceof Player) {
      final Player player=(Player)caster;
      Translate.setThreadLanguage(player.getLanguage());
      final ActionListener actionListener=getAction(action);
      final String type=action.get(Actions.TYPE);
      if (!AdministrationAction.isPlayerAllowedToExecuteAdminCommand(player,type,true)) {
        return false;
      }
      actionListener.onAction(player,action);
      Translate.setThreadLanguage(null);
      return true;
    }
 else {
      logger.error("caster is no Player; cannot execute action " + action + " send by "+ caster,new Throwable());
      return false;
    }
  }
 catch (  final Exception e) {
    logger.error("Cannot execute action " + action + " send by "+ caster,e);
    return false;
  }
}

public static boolean execute ( final RPObject caster , final RPAction action ) { try { if ( caster instanceof Player ) { final Player player = ( Player ) caster ; Translate . setThreadLanguage ( player . getLanguage ( ) ) ; final ActionListener actionListener = getAction ( action ) ; final String type = action . get ( Actions . TYPE ) ; if ( ! AdministrationAction . isPlayerAllowedToExecuteAdminCommand ( player , type , true ) ) { return false ; } actionListener . onAction ( player , action ) ; Translate . setThreadLanguage ( null ) ; return true ; } else { logger . error ( "caster is no Player; cannot execute action " + action + " send by " + caster , new Throwable ( ) ) ; return false ; } } catch ( final Exception e ) { logger . error ( "Cannot execute action " + action + " send by " + caster , e ) ; return false ; } }
executes an action from the client
