From aec9682b2a82a46ab69ae4ab28a2b5e50a158329 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 15 Apr 2019 15:37:40 +0200 Subject: [PATCH] Subcommand perm group --- BuildConfigUpdater/BuildConfigUpdater.iml | 1 - .../ButtonCore (1) (com.github.TBMCPlugins.ButtonCore).iml | 2 +- .../src/main/java/buttondevteam/lib/chat/Command2.java | 7 +++++++ .../src/main/java/buttondevteam/lib/chat/ICommand2MC.java | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/BuildConfigUpdater/BuildConfigUpdater.iml b/BuildConfigUpdater/BuildConfigUpdater.iml index f14440c..274b3de 100644 --- a/BuildConfigUpdater/BuildConfigUpdater.iml +++ b/BuildConfigUpdater/BuildConfigUpdater.iml @@ -12,7 +12,6 @@ - diff --git a/ButtonCore/ButtonCore (1) (com.github.TBMCPlugins.ButtonCore).iml b/ButtonCore/ButtonCore (1) (com.github.TBMCPlugins.ButtonCore).iml index 3c34336..77fac1e 100644 --- a/ButtonCore/ButtonCore (1) (com.github.TBMCPlugins.ButtonCore).iml +++ b/ButtonCore/ButtonCore (1) (com.github.TBMCPlugins.ButtonCore).iml @@ -1,5 +1,5 @@ - + diff --git a/ButtonCore/src/main/java/buttondevteam/lib/chat/Command2.java b/ButtonCore/src/main/java/buttondevteam/lib/chat/Command2.java index bc10fc7..79c8556 100644 --- a/ButtonCore/src/main/java/buttondevteam/lib/chat/Command2.java +++ b/ButtonCore/src/main/java/buttondevteam/lib/chat/Command2.java @@ -46,10 +46,17 @@ public abstract class Command2 @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface Subcommand { + String MOD_GROUP = "mod"; /** * Help text to show players. A usage message will be also shown below it. */ String[] helpText() default {}; + + /** + * The main permission which allows using this command (individual access can be still granted with "thorpe.command.X"). + * Used to be "tbmc.admin" + */ + String permGroup() default ""; //TODO } @Target(ElementType.PARAMETER) diff --git a/ButtonCore/src/main/java/buttondevteam/lib/chat/ICommand2MC.java b/ButtonCore/src/main/java/buttondevteam/lib/chat/ICommand2MC.java index 4ad997b..566285d 100644 --- a/ButtonCore/src/main/java/buttondevteam/lib/chat/ICommand2MC.java +++ b/ButtonCore/src/main/java/buttondevteam/lib/chat/ICommand2MC.java @@ -2,7 +2,7 @@ package buttondevteam.lib.chat; import buttondevteam.lib.architecture.ButtonPlugin; -public class ICommand2MC extends ICommand2 { +public abstract class ICommand2MC extends ICommand2 { public ICommand2MC() { super(ButtonPlugin.getCommand2MC()); }