mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-03 12:31:46 +00:00
Add a cause enum to UserBalanceUpdateEvent (#2824)
Basically, I just needed this for one of my plugins; otherwise, this could be useful for people using this event who want to see where the user's balance is being updated from. --- * Add UserBalanceUpdateEvent.Cause * Add special cause enum * Add API Cause
This commit is contained in:
parent
843ecb4a42
commit
0ebd64d314
6 changed files with 52 additions and 12 deletions
|
@ -9,6 +9,7 @@ import com.earth2me.essentials.utils.StringUtil;
|
|||
|
||||
import com.google.common.collect.Lists;
|
||||
import net.ess3.api.MaxMoneyException;
|
||||
import net.ess3.api.events.UserBalanceUpdateEvent;
|
||||
import org.bukkit.Server;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
@ -73,7 +74,7 @@ public class Commandpay extends EssentialsLoopCommand {
|
|||
user.getConfirmingPayments().put(player, amount);
|
||||
return;
|
||||
}
|
||||
user.payUser(player, amount);
|
||||
user.payUser(player, amount, UserBalanceUpdateEvent.Cause.COMMAND_PAY);
|
||||
user.getConfirmingPayments().remove(player);
|
||||
Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), player.getName(), new Trade(amount, ess), user.getLocation(), ess);
|
||||
} catch (MaxMoneyException ex) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue