From eb9d7e97d9c25b717c24fbfffb76d210b64714e6 Mon Sep 17 00:00:00 2001 From: "Patrick \"IPat\" Hein" Date: Wed, 19 May 2021 17:44:45 +0200 Subject: [PATCH] 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 --- .../com/plotsquared/bukkit/listener/EntityEventListener.java | 2 +- Core/src/main/java/com/plotsquared/core/command/Auto.java | 1 + Core/src/main/java/com/plotsquared/core/command/Claim.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java index 11785e731..2ffe6e34e 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java @@ -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; } diff --git a/Core/src/main/java/com/plotsquared/core/command/Auto.java b/Core/src/main/java/com/plotsquared/core/command/Auto.java index d162a7bbf..d18d9e668 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Auto.java +++ b/Core/src/main/java/com/plotsquared/core/command/Auto.java @@ -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( diff --git a/Core/src/main/java/com/plotsquared/core/command/Claim.java b/Core/src/main/java/com/plotsquared/core/command/Claim.java index f2816400b..21fd34ca7 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Claim.java +++ b/Core/src/main/java/com/plotsquared/core/command/Claim.java @@ -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(