mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-24 22:26:45 +01:00
Fix empty templates when vault not found
This commit is contained in:
parent
891230c78e
commit
a990205d41
@ -312,13 +312,15 @@ public class Auto extends SubCommand {
|
|||||||
player.getPlotCount(plotarea.getWorldName()));
|
player.getPlotCount(plotarea.getWorldName()));
|
||||||
cost = (size_x * size_z) * cost;
|
cost = (size_x * size_z) * cost;
|
||||||
if (cost > 0d) {
|
if (cost > 0d) {
|
||||||
if (!force && this.econHandler.getMoney(player) < cost) {
|
if (!force && this.econHandler.getMoney(player) < cost && this.econHandler.isSupported()) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("economy.cannot_afford_plot"),
|
TranslatableCaption.of("economy.cannot_afford_plot"),
|
||||||
Template.of("money", this.econHandler.format(cost)),
|
Template.of("money", this.econHandler.format(cost)),
|
||||||
Template.of("balance", this.econHandler.format(this.econHandler.getMoney(player)))
|
Template.of("balance", this.econHandler.format(this.econHandler.getMoney(player)))
|
||||||
);
|
);
|
||||||
return true;
|
} else {
|
||||||
|
player.sendMessage(TranslatableCaption.of("economy.vault_not_found"));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
this.econHandler.withdrawMoney(player, cost);
|
this.econHandler.withdrawMoney(player, cost);
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
|
@ -98,7 +98,7 @@ public class Buy extends Command {
|
|||||||
throw new CommandException(TranslatableCaption.of("economy.not_for_sale"));
|
throw new CommandException(TranslatableCaption.of("economy.not_for_sale"));
|
||||||
}
|
}
|
||||||
checkTrue(
|
checkTrue(
|
||||||
this.econHandler.getMoney(player) >= price,
|
this.econHandler.getMoney(player) >= price && this.econHandler.isSupported(),
|
||||||
TranslatableCaption.of("economy.cannot_afford_plot"),
|
TranslatableCaption.of("economy.cannot_afford_plot"),
|
||||||
Template.of("money", this.econHandler.format(price)),
|
Template.of("money", this.econHandler.format(price)),
|
||||||
Template.of("balance", this.econHandler.format(this.econHandler.getMoney(player)))
|
Template.of("balance", this.econHandler.format(this.econHandler.getMoney(player)))
|
||||||
|
@ -151,12 +151,14 @@ public class Claim extends SubCommand {
|
|||||||
PlotExpression costExr = area.getPrices().get("claim");
|
PlotExpression costExr = area.getPrices().get("claim");
|
||||||
double cost = costExr.evaluate(currentPlots);
|
double cost = costExr.evaluate(currentPlots);
|
||||||
if (cost > 0d) {
|
if (cost > 0d) {
|
||||||
if (this.econHandler.getMoney(player) < cost) {
|
if (this.econHandler.getMoney(player) < cost && this.econHandler.isSupported()) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("economy.cannot_afford_plot"),
|
TranslatableCaption.of("economy.cannot_afford_plot"),
|
||||||
Template.of("money", this.econHandler.format(cost)),
|
Template.of("money", this.econHandler.format(cost)),
|
||||||
Template.of("balance", this.econHandler.format(this.econHandler.getMoney(player)))
|
Template.of("balance", this.econHandler.format(this.econHandler.getMoney(player)))
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
player.sendMessage(TranslatableCaption.of("economy.vault_not_found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.econHandler.withdrawMoney(player, cost);
|
this.econHandler.withdrawMoney(player, cost);
|
||||||
|
@ -103,6 +103,7 @@
|
|||||||
"tutorial.rate_this": "<prefix><gray>Rate this plot!</gray>",
|
"tutorial.rate_this": "<prefix><gray>Rate this plot!</gray>",
|
||||||
"tutorial.comment_this": "<prefix><gray>Leave some feedback on this plot: <plot>.</gray>",
|
"tutorial.comment_this": "<prefix><gray>Leave some feedback on this plot: <plot>.</gray>",
|
||||||
"economy.econ_disabled": "<prefix><red>Economy is not enabled.</red>",
|
"economy.econ_disabled": "<prefix><red>Economy is not enabled.</red>",
|
||||||
|
"economy.vault_not_found": "<prefix><red>Vault is not installed. No Vault-like economy service can be provided.</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.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.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.cannot_buy_own": "<prefix><red>You cannot buy your own plot.</red>",
|
||||||
|
Loading…
Reference in New Issue
Block a user