From 35dd4899b90ca0aaebd1de03ecfcad850764aa61 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 9 Oct 2022 15:27:35 +0100 Subject: [PATCH] feat: add cost for the merge when using plot auto-merge - Closes #3814 --- Core/src/main/java/com/plotsquared/core/command/Auto.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 60ed4bfea..4b37d237d 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Auto.java +++ b/Core/src/main/java/com/plotsquared/core/command/Auto.java @@ -293,10 +293,12 @@ public class Auto extends SubCommand { } if (this.econHandler != null && plotarea.useEconomy()) { PlotExpression costExp = plotarea.getPrices().get("claim"); + PlotExpression mergeCostExp = plotarea.getPrices().get("merge"); + double mergeCost = mergeCostExp == null ? 0d : mergeCostExp.evaluate(sizeX * sizeZ); double cost = costExp.evaluate(Settings.Limit.GLOBAL ? player.getPlotCount() : player.getPlotCount(plotarea.getWorldName())); - cost = (sizeX * sizeZ) * cost; + cost = (sizeX * sizeZ) * cost + mergeCost; if (cost > 0d) { if (!this.econHandler.isSupported()) { player.sendMessage(TranslatableCaption.of("economy.vault_or_consumer_null"));