From 46d1fa14990f9d3b6b9611e08f4e953f886291c9 Mon Sep 17 00:00:00 2001 From: Timongcraft Date: Sat, 24 Feb 2024 11:56:22 +0100 Subject: [PATCH 1/5] Exposed the string permission Made the optional string permission in the CommandPermission public --- .../src/main/java/dev/jorel/commandapi/CommandPermission.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java b/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java index e676c90fb9..92e5aa3296 100644 --- a/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java +++ b/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java @@ -125,7 +125,7 @@ public String toString() { return (negated ? "not " : "") + result; } - Optional getPermission() { + public Optional getPermission() { return Optional.ofNullable(this.permission); } From e30547651f762e00c2fa19c32a87eb103a7d868f Mon Sep 17 00:00:00 2001 From: Timongcraft Date: Sat, 24 Feb 2024 15:07:53 +0100 Subject: [PATCH 2/5] Added pr changes to changelog --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3321031a3d..fe55ee5f8e 100644 --- a/README.md +++ b/README.md @@ -421,6 +421,7 @@ This is the current roadmap for the CommandAPI (as of 11th May 2023):
  • https://github.com/JorelAli/CommandAPI/issues/495 Adds a parameter to EntitySelectorArgument to allow failure when no entity lists are empty
  • https://github.com/JorelAli/CommandAPI/issues/367, https://github.com/JorelAli/CommandAPI/pull/509 Adds the ability to register commands with a custom namespace
  • +
  • https://github.com/JorelAli/CommandAPI/pull/523 Made the optional string permission in the CommandPermission public
From c74dadacfc92c212a48b0cb9c8e9d0d76fccaa4c Mon Sep 17 00:00:00 2001 From: Timongcraft Date: Sat, 24 Feb 2024 16:02:23 +0100 Subject: [PATCH 3/5] Made negation state of CommandPermission also public Added javadoc --- .../jorel/commandapi/CommandPermission.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java b/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java index 92e5aa3296..ac9a0c1d3e 100644 --- a/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java +++ b/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java @@ -125,16 +125,26 @@ public String toString() { return (negated ? "not " : "") + result; } + /** + * Returns the custom permission in string form if set + * + * @return An {@code Optional} with the custom permission or an empty {@code Optional} if not set + */ public Optional getPermission() { return Optional.ofNullable(this.permission); } - PermissionNode getPermissionNode() { - return this.permissionNode; + /** + * Returns if the permission is negated + * + * @return the permissions negation state + */ + public boolean isNegated() { + return this.negated; } - boolean isNegated() { - return this.negated; + PermissionNode getPermissionNode() { + return this.permissionNode; } CommandPermission negate() { From 297604b68308d7a69bf262e92120c3c4fcd164e0 Mon Sep 17 00:00:00 2001 From: Timongcraft Date: Sun, 25 Feb 2024 16:07:46 +0100 Subject: [PATCH 4/5] Updated changelog --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fe55ee5f8e..2964bdcaa5 100644 --- a/README.md +++ b/README.md @@ -421,7 +421,7 @@ This is the current roadmap for the CommandAPI (as of 11th May 2023):
  • https://github.com/JorelAli/CommandAPI/issues/495 Adds a parameter to EntitySelectorArgument to allow failure when no entity lists are empty
  • https://github.com/JorelAli/CommandAPI/issues/367, https://github.com/JorelAli/CommandAPI/pull/509 Adds the ability to register commands with a custom namespace
  • -
  • https://github.com/JorelAli/CommandAPI/pull/523 Made the optional string permission in the CommandPermission public
  • +
  • https://github.com/JorelAli/CommandAPI/pull/523 Exposed more details of the CommandPermission
From abda634275ea5ca39446e3a1454936e8c5195cff Mon Sep 17 00:00:00 2001 From: Timongcraft Date: Sun, 25 Feb 2024 17:46:51 +0100 Subject: [PATCH 5/5] Fixed javadoc spelling --- .../src/main/java/dev/jorel/commandapi/CommandPermission.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java b/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java index ac9a0c1d3e..adcdcb884c 100644 --- a/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java +++ b/commandapi-core/src/main/java/dev/jorel/commandapi/CommandPermission.java @@ -137,7 +137,7 @@ public Optional getPermission() { /** * Returns if the permission is negated * - * @return the permissions negation state + * @return the permission's negation state */ public boolean isNegated() { return this.negated;