From ca883c211a299c23496d0862a30f341f53d747ff Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 18 Jan 2019 19:02:12 +0000 Subject: [PATCH] Add merge permission changes from master --- .../plotsquared/plot/commands/Merge.java | 8 ++++++++ .../intellectualsites/plotsquared/plot/config/C.java | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java index 0d183ce8a..42075f2d2 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java @@ -96,6 +96,10 @@ public class Merge extends SubCommand { if (args.length == 2) { terrain = "true".equalsIgnoreCase(args[1]); } + if(!terrain && !Permissions.hasPermission(player, C.PERMISSION_MERGE_KEEPROAD)) { + MainUtil.sendMessage(player, C.NO_PERMISSION, C.PERMISSION_MERGE_KEEPROAD.s()); + return true; + } if (plot.autoMerge(-1, maxSize, uuid, terrain)) { if (EconHandler.manager != null && plotArea.USE_ECONOMY && price > 0d) { EconHandler.manager.withdrawMoney(player, price); @@ -128,6 +132,10 @@ public class Merge extends SubCommand { } else { terrain = true; } + if(!terrain && !Permissions.hasPermission(player, C.PERMISSION_MERGE_KEEPROAD)) { + MainUtil.sendMessage(player, C.NO_PERMISSION, C.PERMISSION_MERGE_KEEPROAD.s()); + return true; + } if (plot.autoMerge(direction, maxSize - size, uuid, terrain)) { if (EconHandler.manager != null && plotArea.USE_ECONOMY && price > 0d) { EconHandler.manager.withdrawMoney(player, price); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/C.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/C.java index d487d883a..d3045c568 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/C.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/C.java @@ -46,7 +46,8 @@ public enum C { "plots.admin.entry.denied", "static.permissions"), PERMISSION_ADMIN_ENTRY_FORCEFIELD( "plots.admin.entry.forcefield", "static.permissions"), PERMISSION_COMMANDS_CHAT( "plots.admin.command.chat", "static.permissions"), PERMISSION_MERGE_OTHER( - "plots.merge.other", "static.permissions"), PERMISSION_ADMIN_DESTROY_UNOWNED( + "plots.merge.other", "static.permissions"), PERMISSION_MERGE_KEEPROAD( + "plots.merge.keeproad", "static.permissions"), PERMISSION_ADMIN_DESTROY_UNOWNED( "plots.admin.destroy.unowned", "static.permissions"), PERMISSION_ADMIN_DESTROY_GROUNDLEVEL( "plots.admin.destroy.groundlevel", "static.permissions"), PERMISSION_ADMIN_DESTROY_OTHER( "plots.admin.destroy.other", "static.permissions"), PERMISSION_ADMIN_DESTROY_ROAD( @@ -141,8 +142,9 @@ public enum C { PERMISSION_SET_COMPONENT("plots.set.%s0", "static.permissions"), PERMISSION_ADMIN_COMMAND( "plots.admin.command.%s0", "static.permissions"), - PERMISSION_ADMIN_COMMAND_UNLINK("plots.admin.command.unlink", "static.permissions"), PERMISSION_VISIT_UNOWNED( - "plots.visit.unowned", "static.permissions"), + PERMISSION_ADMIN_COMMAND_UNLINK("plots.admin.command.unlink", + "static.permissions"), PERMISSION_VISIT_UNOWNED("plots.visit.unowned", + "static.permissions"), PERMISSION_VISIT_OWNED("plots.visit.owned", "static.permissions"), PERMISSION_SHARED( "plots.visit.shared", "static.permissions"),