Bug through last Economy PR - Withdrawn money for non-affordable plots (#3036)

* Replaced economy supported (Vault) check within cost condition with a pre-eliminating if-guard

* Negate mob-place flag debug message

* Actually prevent purchase of plots if they can't afford it (whoops)

Co-authored-by: NotMyFault <mc.cache@web.de>
This commit is contained in:
Patrick "IPat" Hein 2021-05-19 17:44:45 +02:00 committed by GitHub
parent 24eebe6711
commit eb9d7e97d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -315,7 +315,7 @@ public class EntityEventListener implements Listener {
PlotArea area = location.getPlotArea();
if (area != null) {
Plot plot = area.getOwnedPlot(location);
if (plot != null && plot.getFlag(MobPlaceFlag.class)) {
if (plot != null && !plot.getFlag(MobPlaceFlag.class)) {
plot.debug(e.getType() + " could not change block because mob-place = false");
return;
}

View File

@ -323,6 +323,7 @@ public class Auto extends SubCommand {
Template.of("money", this.econHandler.format(cost)),
Template.of("balance", this.econHandler.format(this.econHandler.getMoney(player)))
);
return false;
}
this.econHandler.withdrawMoney(player, cost);
player.sendMessage(

View File

@ -161,6 +161,7 @@ public class Claim extends SubCommand {
Template.of("money", this.econHandler.format(cost)),
Template.of("balance", this.econHandler.format(this.econHandler.getMoney(player)))
);
return false;
}
this.econHandler.withdrawMoney(player, cost);
player.sendMessage(