From 12fe46f4b0184c6a1a31783a69accb15585f4013 Mon Sep 17 00:00:00 2001 From: Moulberry Date: Sat, 4 May 2024 23:36:47 +0800 Subject: [PATCH] Fix SectionPermissionChecker combination --- .../axiom/integration/SectionPermissionChecker.java | 8 ++++++-- src/main/resources/plugin.yml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/moulberry/axiom/integration/SectionPermissionChecker.java b/src/main/java/com/moulberry/axiom/integration/SectionPermissionChecker.java index 97f4eb5..50f1a5d 100644 --- a/src/main/java/com/moulberry/axiom/integration/SectionPermissionChecker.java +++ b/src/main/java/com/moulberry/axiom/integration/SectionPermissionChecker.java @@ -13,10 +13,10 @@ public interface SectionPermissionChecker { if (first.noneAllowed() || second.noneAllowed()) { return NONE_ALLOWED; } - if (first.allAllowed()) { + if (first == ALL_ALLOWED) { return second; } - if (second.allAllowed()) { + if (second == ALL_ALLOWED) { return first; } @@ -25,6 +25,10 @@ public interface SectionPermissionChecker { return NONE_ALLOWED; } + if (first.allAllowed() && second.allAllowed()) { + return new AllAllowedInBox(intersect); + } + return new SectionPermissionChecker() { @Override public boolean allAllowed() { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 8afb8ab..2531c61 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -24,7 +24,7 @@ permissions: axiom.allow_copying_other_plots: description: This permission allows users to copy other user's plots - default: false # true + default: true axiom.can_import_blocks: description: Allows players to import schematics/blueprints into Axiom default: true