mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-15 13:36:31 +00:00
Give money back to sender if MaxMoneyException thrown (fixes #106)
This commit is contained in:
parent
9fb0ab57e6
commit
d7b0f74a75
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), player.getName(), new Trade(amount, ess), user.getLocation(), ess);
|
||||||
} catch (MaxMoneyException ex) {
|
} catch (MaxMoneyException ex) {
|
||||||
sender.sendMessage(tl("maxMoney"));
|
sender.sendMessage(tl("maxMoney"));
|
||||||
|
try {
|
||||||
|
user.setMoney(user.getMoney().add(amount));
|
||||||
|
} catch (MaxMoneyException ignored) {
|
||||||
|
// this should never happen
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue