Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 18:40:05 +01:00
Tabs.
Dieser Commit ist enthalten in:
Ursprung
bf2c8ebed4
Commit
a669ef95c6
@ -56,18 +56,18 @@ public class CommandsManagerRegistration extends CommandRegistration {
|
|||||||
for (Command command : registered) {
|
for (Command command : registered) {
|
||||||
List<String> permissions = null;
|
List<String> permissions = null;
|
||||||
Method cmdMethod = commands.getMethods().get(null).get(command.aliases()[0]);
|
Method cmdMethod = commands.getMethods().get(null).get(command.aliases()[0]);
|
||||||
Map<String, Method> childMethods = commands.getMethods().get(cmdMethod);
|
Map<String, Method> childMethods = commands.getMethods().get(cmdMethod);
|
||||||
|
|
||||||
if (cmdMethod != null && cmdMethod.isAnnotationPresent(CommandPermissions.class)) {
|
if (cmdMethod != null && cmdMethod.isAnnotationPresent(CommandPermissions.class)) {
|
||||||
permissions = Arrays.asList(cmdMethod.getAnnotation(CommandPermissions.class).value());
|
permissions = Arrays.asList(cmdMethod.getAnnotation(CommandPermissions.class).value());
|
||||||
} else if (cmdMethod != null && childMethods != null && childMethods.size() > 0) {
|
} else if (cmdMethod != null && childMethods != null && childMethods.size() > 0) {
|
||||||
permissions = new ArrayList<String>();
|
permissions = new ArrayList<String>();
|
||||||
for (Method m : childMethods.values()) {
|
for (Method m : childMethods.values()) {
|
||||||
if (m.isAnnotationPresent(CommandPermissions.class)) {
|
if (m.isAnnotationPresent(CommandPermissions.class)) {
|
||||||
permissions.addAll(Arrays.asList(m.getAnnotation(CommandPermissions.class).value()));
|
permissions.addAll(Arrays.asList(m.getAnnotation(CommandPermissions.class).value()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toRegister.add(new CommandInfo(command.usage(), command.desc(), command.aliases(), commands, permissions == null ? null : permissions.toArray(new String[permissions.size()])));
|
toRegister.add(new CommandInfo(command.usage(), command.desc(), command.aliases(), commands, permissions == null ? null : permissions.toArray(new String[permissions.size()])));
|
||||||
}
|
}
|
||||||
|
@ -100,18 +100,18 @@ public class BukkitServerInterface extends ServerInterface {
|
|||||||
for (Command command : commands) {
|
for (Command command : commands) {
|
||||||
List<String> permissions = null;
|
List<String> permissions = null;
|
||||||
Method cmdMethod = manager.getMethods().get(null).get(command.aliases()[0]);
|
Method cmdMethod = manager.getMethods().get(null).get(command.aliases()[0]);
|
||||||
Map<String, Method> childMethods = manager.getMethods().get(cmdMethod);
|
Map<String, Method> childMethods = manager.getMethods().get(cmdMethod);
|
||||||
|
|
||||||
if (cmdMethod != null && cmdMethod.isAnnotationPresent(CommandPermissions.class)) {
|
if (cmdMethod != null && cmdMethod.isAnnotationPresent(CommandPermissions.class)) {
|
||||||
permissions = Arrays.asList(cmdMethod.getAnnotation(CommandPermissions.class).value());
|
permissions = Arrays.asList(cmdMethod.getAnnotation(CommandPermissions.class).value());
|
||||||
} else if (cmdMethod != null && childMethods != null && childMethods.size() > 0) {
|
} else if (cmdMethod != null && childMethods != null && childMethods.size() > 0) {
|
||||||
permissions = new ArrayList<String>();
|
permissions = new ArrayList<String>();
|
||||||
for (Method m : childMethods.values()) {
|
for (Method m : childMethods.values()) {
|
||||||
if (m.isAnnotationPresent(CommandPermissions.class)) {
|
if (m.isAnnotationPresent(CommandPermissions.class)) {
|
||||||
permissions.addAll(Arrays.asList(m.getAnnotation(CommandPermissions.class).value()));
|
permissions.addAll(Arrays.asList(m.getAnnotation(CommandPermissions.class).value()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toRegister.add(new CommandInfo(command.usage(), command.desc(), command.aliases(), commands, permissions == null ? null : permissions.toArray(new String[permissions.size()])));
|
toRegister.add(new CommandInfo(command.usage(), command.desc(), command.aliases(), commands, permissions == null ? null : permissions.toArray(new String[permissions.size()])));
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren