mirror of
https://github.com/xHyroM/lighteco.git
synced 2024-11-21 14:31:09 +01:00
fix(pay): add check if you're trying to pay yourself
This commit is contained in:
parent
a99fb995e4
commit
c902a6a989
1 changed files with 8 additions and 0 deletions
|
@ -114,6 +114,14 @@ public abstract class AbstractCommandManager implements CommandManager {
|
|||
|
||||
@Override
|
||||
public void onPay(CommandSender sender, Currency currency, User target, BigDecimal amount) {
|
||||
if (sender.getUniqueId() != null && (sender.getUniqueId() == target.getUniqueId())) {
|
||||
sender.sendMessage(
|
||||
miniMessage.deserialize("<red>You cannot pay yourself!")
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
addToMustWait(sender.getUniqueId(), target.getUniqueId());
|
||||
|
||||
User user = this.plugin.getUserManager().getIfLoaded(sender.getUniqueId());
|
||||
|
|
Loading…
Reference in a new issue