diff --git a/src/main/java/com/intellectualcrafters/plot/PS.java b/src/main/java/com/intellectualcrafters/plot/PS.java index b13ec834f..ae485bab9 100644 --- a/src/main/java/com/intellectualcrafters/plot/PS.java +++ b/src/main/java/com/intellectualcrafters/plot/PS.java @@ -1795,8 +1795,9 @@ public class PS { config.set("clear.ignore-if-modified", null); // Done - config.set("approval.ratings.require-done", Settings.REQUIRE_DONE); - config.set("approval.done.counts-towards-limit", Settings.DONE_COUNTS_TOWARDS_LIMIT); + options.put("approval.ratings.require-done", Settings.REQUIRE_DONE); + options.put("approval.done.counts-towards-limit", Settings.DONE_COUNTS_TOWARDS_LIMIT); + options.put("approval.done.restrict-building", Settings.DONE_RESTRICTS_BUILDING); // Schematics options.put("schematics.save_path", Settings.SCHEMATIC_SAVE_PATH); @@ -1905,6 +1906,7 @@ public class PS { // Done Settings.REQUIRE_DONE = config.getBoolean("approval.ratings.require-done"); Settings.DONE_COUNTS_TOWARDS_LIMIT = config.getBoolean("approval.done.counts-towards-limit"); + Settings.DONE_RESTRICTS_BUILDING = config.getBoolean("approval.done.restrict-building"); // Schematics Settings.SCHEMATIC_SAVE_PATH = config.getString("schematics.save_path"); diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Clear.java b/src/main/java/com/intellectualcrafters/plot/commands/Clear.java index fdaf2ec9a..22d00915c 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Clear.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Clear.java @@ -88,7 +88,7 @@ public class Clear extends SubCommand { MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER); return false; } - if (FlagManager.isPlotFlagTrue(plot, "done" ) && (!Permissions.hasPermission(plr, "plots.continue") || (Settings.DONE_COUNTS_TOWARDS_LIMIT && MainUtil.getAllowedPlots(plr) >= MainUtil.getPlayerPlotCount(plr)))) { + if (Settings.DONE_RESTRICTS_BUILDING && FlagManager.isPlotFlagTrue(plot, "done" ) && (!Permissions.hasPermission(plr, "plots.continue") || (Settings.DONE_COUNTS_TOWARDS_LIMIT && MainUtil.getAllowedPlots(plr) >= MainUtil.getPlayerPlotCount(plr)))) { MainUtil.sendMessage(plr, C.DONE_ALREADY_DONE); return false; } diff --git a/src/main/java/com/intellectualcrafters/plot/config/Settings.java b/src/main/java/com/intellectualcrafters/plot/config/Settings.java index 1555c7b53..a93f9b8d0 100644 --- a/src/main/java/com/intellectualcrafters/plot/config/Settings.java +++ b/src/main/java/com/intellectualcrafters/plot/config/Settings.java @@ -46,13 +46,14 @@ public class Settings { */ public static String WEB_URL = "http://empcraft.com/plots/"; public static String WEB_IP = "your.ip.here"; - /** * Ratings */ public static List RATING_CATEGORIES = null; public static boolean REQUIRE_DONE = false; public static boolean DONE_COUNTS_TOWARDS_LIMIT = false; + public static boolean DONE_RESTRICTS_BUILDING = false; + /** * PlotMe settings */ diff --git a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 3233c5ff6..990f9faae 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -656,7 +656,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_DESTROY_OTHER); event.setCancelled(true); } - else if (plot.getSettings().flags.containsKey("done")) { + else if (Settings.DONE_RESTRICTS_BUILDING && plot.getSettings().flags.containsKey("done")) { if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) { MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER); event.setCancelled(true); @@ -2071,7 +2071,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen return; } } - else if (plot.getSettings().flags.containsKey("done")) { + else if (Settings.DONE_RESTRICTS_BUILDING && plot.getSettings().flags.containsKey("done")) { if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) { MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER); event.setCancelled(true); diff --git a/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WEManager.java b/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WEManager.java index c92d3916e..14a14fa30 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WEManager.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WEManager.java @@ -28,7 +28,7 @@ public class WEManager { HashSet regions = new HashSet<>(); UUID uuid = player.getUUID(); for (Plot plot : PS.get().getPlotsInWorld(player.getLocation().getWorld())) { - if (plot.isBasePlot() && FlagManager.getPlotFlag(plot, "done") == null) { + if (Settings.DONE_RESTRICTS_BUILDING && plot.isBasePlot() && FlagManager.getPlotFlag(plot, "done") == null) { if (Settings.WE_ALLOW_HELPER ? plot.isAdded(uuid) : (plot.isOwner(uuid) || plot.getTrusted().contains(uuid))) { Location pos1 = MainUtil.getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1); Location pos2 = MainUtil.getPlotTopLoc(plot.world, plot.id); diff --git a/src/main/java/com/plotsquared/sponge/listener/MainListener.java b/src/main/java/com/plotsquared/sponge/listener/MainListener.java index c5a920f92..cf4a1a754 100644 --- a/src/main/java/com/plotsquared/sponge/listener/MainListener.java +++ b/src/main/java/com/plotsquared/sponge/listener/MainListener.java @@ -515,7 +515,7 @@ public class MainListener { MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_DESTROY_OTHER); event.setCancelled(true); } - else if (plot.getSettings().flags.containsKey("done")) { + else if (Settings.DONE_RESTRICTS_BUILDING && plot.getSettings().flags.containsKey("done")) { if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) { MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER); event.setCancelled(true); @@ -568,7 +568,7 @@ public class MainListener { MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_DESTROY_OTHER); event.setCancelled(true); } - else if (plot.getSettings().flags.containsKey("done")) { + else if (Settings.DONE_RESTRICTS_BUILDING && plot.getSettings().flags.containsKey("done")) { if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) { MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER); event.setCancelled(true);