mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
compute BaseCommand permissions before RegisteredCommands
Need to be computed for inheritance
This commit is contained in:
@@ -252,8 +252,8 @@ public abstract class BaseCommand {
|
||||
this.parentSubcommand = getParentSubcommand(self);
|
||||
this.conditions = annotations.getAnnotationValue(self, Conditions.class, Annotations.REPLACEMENTS | Annotations.NO_EMPTY);
|
||||
|
||||
computePermissions(); // Must be before any subcommands so they can inherit permissions
|
||||
registerSubcommands();
|
||||
computePermissions();
|
||||
registerSubclasses(cmd);
|
||||
|
||||
if (cmdAliases != null) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.CommandHelp;
|
||||
import co.aikar.commands.annotation.CatchUnknown;
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
import co.aikar.commands.annotation.CommandPermission;
|
||||
import co.aikar.commands.annotation.Default;
|
||||
import co.aikar.commands.annotation.HelpCommand;
|
||||
import co.aikar.commands.annotation.Single;
|
||||
@@ -12,9 +13,11 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandAlias("soctest")
|
||||
@CommandPermission("soc.parent")
|
||||
public class SomeOtherCommand extends BaseCommand {
|
||||
|
||||
@Subcommand("foo")
|
||||
@CommandPermission("soc.foo")
|
||||
public void onFoo1(Player player) {
|
||||
player.sendMessage("you foo'd");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user