use of io.github.nucleuspowered.nucleus.internal.annotations.command.PermissionsFrom in project Nucleus by NucleusPowered.
the class PermissionRegistry method getPermissionsForNucleusCommand.
public CommandPermissionHandler getPermissionsForNucleusCommand(Class<? extends AbstractCommand> command) {
if (this.serviceRegistry.containsKey(command)) {
return this.serviceRegistry.get(command);
}
PermissionsFrom p = command.getAnnotation(PermissionsFrom.class);
if (p != null && p.value() != AbstractCommand.class) {
return getPermissionsForNucleusCommand(p.value());
}
CommandPermissionHandler handler = new CommandPermissionHandler(command, Nucleus.getNucleus());
serviceRegistry.put(command, handler);
return handler;
}
Aggregations