APISonar


com.earth2me.essentials.Trade.log

> com > earth2me > essentials > Trade > log
com APIs earth2me APIs essentials APIs Trade APIs log APIs

Example 1
public static void resetBalance(String name) throws UserDoesNotExistException, NoLoanPermittedException
	{
		if (ess == null)
		{
			throw new RuntimeException(noCallBeforeLoad);
		}
		setMoney(name, ess.getSettings().getStartingBalance());
		Trade.log("API", "Reset", "API", name, new Trade(BigDecimal.ZERO, ess), null, null, null, ess);
	}
Example 2
protected void updatePlayer(final Server server, final CommandSource sender, final User player, final String[] args) throws ChargeException
	{
		User user = ess.getUser(sender.getPlayer());
		try
		{
			user.payUser(player, amount);
			Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), player.getName(), new Trade(amount, ess), user.getLocation(), ess);
		}
		catch (MaxMoneyException ex)
		{
			sender.sendMessage(tl("maxMoney"));
		}
	}
Example 3
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException, MaxMoneyException
	{
		final Trade charge = getTrade(sign, 1, 2, player, ess);
		final Trade money = getTrade(sign, 3, ess);
		charge.isAffordableFor(player);
		money.pay(player, OverflowType.DROP);
		charge.charge(player);
		Trade.log("Sign", "Sell", "Interact", username, charge, username, money, sign.getBlock().getLocation(), ess);
		return true;
	}