Example #1
0
 /**
  * Attempts to begin a trade for the two given players
  *
  * @param initiator The player who initiated the trade
  * @param target The target of the initiator
  */
 public void requestTrade(Player initiator, Player target) {
   if (playersIgnoring.contains(target.getName())) {
     initiator.sendMessage(
         ChatColor.RED
             + target.getName()
             + " "
             + LanguageManager.getString(LanguageManager.Strings.PLAYERIGNORING));
   } else if (config.canTrade(initiator, target)) {
     manager.begin(new TradePlayer(initiator), new TradePlayer(target));
   }
 }
Example #2
0
  @Override
  public void onEnable() {
    Log.serLogger(this.getLogger());
    InventoryUtils.setPlugin(this);

    config = new ConfigManager(this);
    languageManager = new LanguageManager(this);
    manager = new TradeManager(this);

    new VgTradeInventoryListener(this);
    new VgTradePlayerListener(this);

    Log.verbose = config.isVerboseLoggingEnabled();

    Log.init(this.getDataFolder());
    Log.info("Enabled!");
  }