From 3796072c3a8738f62c991d469e8d9eb8972ef2af Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Mon, 5 Jun 2023 20:25:36 +0100 Subject: [PATCH] feat: add a permission requirement to /plot merge all --- Core/src/main/java/com/plotsquared/core/command/Merge.java | 2 +- .../main/java/com/plotsquared/core/permissions/Permission.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Merge.java b/Core/src/main/java/com/plotsquared/core/command/Merge.java index 24e842645..97a3965c7 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Merge.java +++ b/Core/src/main/java/com/plotsquared/core/command/Merge.java @@ -109,7 +109,7 @@ public class Merge extends SubCommand { } } if (direction == null && (args[0].equalsIgnoreCase("all") || args[0] - .equalsIgnoreCase("auto"))) { + .equalsIgnoreCase("auto")) && player.hasPermission(Permission.PERMISSION_MERGE_ALL)) { direction = Direction.ALL; } } diff --git a/Core/src/main/java/com/plotsquared/core/permissions/Permission.java b/Core/src/main/java/com/plotsquared/core/permissions/Permission.java index 806dcfc9b..43205ca3d 100644 --- a/Core/src/main/java/com/plotsquared/core/permissions/Permission.java +++ b/Core/src/main/java/com/plotsquared/core/permissions/Permission.java @@ -45,6 +45,7 @@ public enum Permission implements ComponentLike { PERMISSION_ADMIN_ENTRY_FORCEFIELD("plots.admin.entry.forcefield"), PERMISSION_ADMIN_COMMANDS_CHATSPY("plots.admin.command.chatspy"), PERMISSION_MERGE("plots.merge"), + PERMISSION_MERGE_ALL("plots.merge.all"), PERMISSION_MERGE_OTHER("plots.merge.other"), PERMISSION_MERGE_KEEP_ROAD("plots.merge.keeproad"), PERMISSION_ADMIN_CAPS_OTHER("plots.admin.caps.other"),