From 53e732b4fe6f8af434dcc0dfa666a1dcc2f97dee Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 22 Feb 2019 15:21:44 +0000 Subject: [PATCH] Make replacing wall on merge configurable In case people are doing fun things with road schematics etc :) --- .../plotsquared/plot/config/Settings.java | 1 + .../plotsquared/plot/generator/ClassicPlotManager.java | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java index 1f7f6a88d..281e35caf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java @@ -224,6 +224,7 @@ public class Settings extends Config { @Comment("General settings") public static final class General { @Comment("Display scientific numbers (4.2E8)") public static boolean SCIENTIFIC = false; + @Comment("Replace wall when merging") public static boolean MERGE_REPLACE_WALL = true; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java index 5a44f30b2..fffe38966 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/ClassicPlotManager.java @@ -1,5 +1,6 @@ package com.github.intellectualsites.plotsquared.plot.generator; +import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.object.*; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; @@ -432,9 +433,11 @@ public class ClassicPlotManager extends SquarePlotManager { */ @Override public boolean finishPlotMerge(PlotArea plotArea, List plotIds) { final BlockBucket block = ((ClassicPlotWorld) plotArea).CLAIMED_WALL_BLOCK; - final BlockBucket wallBlock = ((ClassicPlotWorld) plotArea).WALL_FILLING; plotIds.forEach(id -> setWall(plotArea, id, block)); - plotIds.forEach(id -> setWallFilling(plotArea, id, wallBlock)); + if (Settings.General.MERGE_REPLACE_WALL) { + final BlockBucket wallBlock = ((ClassicPlotWorld) plotArea).WALL_FILLING; + plotIds.forEach(id -> setWallFilling(plotArea, id, wallBlock)); + } return true; }