mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-27 09:42:41 +01:00
Give money back to sender if MaxMoneyException thrown (fixes #106)
This commit is contained in:
parent
9fb0ab57e6
commit
d7b0f74a75
@ -43,6 +43,11 @@ public class Commandpay extends EssentialsLoopCommand {
|
||||
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"));
|
||||
try {
|
||||
user.setMoney(user.getMoney().add(amount));
|
||||
} catch (MaxMoneyException ignored) {
|
||||
// this should never happen
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user