mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Fix /plot buy message and enhance it with player balance
This commit is contained in:
parent
47cb85d3db
commit
9478251d44
@ -285,7 +285,8 @@ public class Auto extends SubCommand {
|
||||
if (!force && this.econHandler.getMoney(player) < cost) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("economy.cannot_afford_plot"),
|
||||
Template.of("money", String.valueOf(cost))
|
||||
Template.of("money", String.valueOf(cost)),
|
||||
Template.of("balance", String.valueOf(this.econHandler.getMoney(player)))
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
@ -94,7 +94,9 @@ public class Buy extends Command {
|
||||
throw new CommandException(TranslatableCaption.of("economy.not_for_sale"));
|
||||
}
|
||||
checkTrue(this.econHandler.getMoney(player) >= price,
|
||||
TranslatableCaption.of("economy.cannot_afford_plot"));
|
||||
TranslatableCaption.of("economy.cannot_afford_plot"),
|
||||
Template.of("money", String.valueOf(price)),
|
||||
Template.of("balance", String.valueOf(this.econHandler.getMoney(player))));
|
||||
this.econHandler.withdrawMoney(player, price);
|
||||
// Failure
|
||||
// Success
|
||||
|
@ -147,7 +147,8 @@ public class Claim extends SubCommand {
|
||||
this.econHandler.withdrawMoney(player, cost);
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("economy.removed_balance"),
|
||||
Template.of("money", String.valueOf(cost))
|
||||
Template.of("money", String.valueOf(cost)),
|
||||
Template.of("balance", String.valueOf(this.econHandler.getMoney(player)))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -124,7 +124,7 @@
|
||||
"tutorial.comment_this": "<prefix><gray>Leave some feedback on this plot: <plot>.</gray>",
|
||||
|
||||
"economy.econ_disabled": "<prefix><red>Economy is not enabled.</red>",
|
||||
"economy.cannot_afford_plot": "<prefix><red>You cannot afford to buy this plot. It costs <gold><money></gold>.</red>",
|
||||
"economy.cannot_afford_plot": "<prefix><red>You cannot afford to buy this plot. It costs <gold><money></gold>. You have <gold><balance></gold>.</red>",
|
||||
"economy.not_for_sale": "<prefix><red>This plot is not for sale.</red>",
|
||||
"economy.cannot_buy_own": "<prefix><red>You cannot buy your own plot.</red>",
|
||||
"economy.plot_sold": "<prefix><dark_aqua>Your plot; <gold><plot></gold>, has been sold to <gold><player></gold> for <gold><price></gold>.</dark_aqua>",
|
||||
|
Loading…
Reference in New Issue
Block a user