From a669ef95c63099dc23e56888697c7a457f0422e7 Mon Sep 17 00:00:00 2001 From: wizjany Date: Tue, 6 Aug 2013 23:50:02 -0400 Subject: [PATCH] Tabs. --- .../util/CommandsManagerRegistration.java | 18 +++++++++--------- .../bukkit/BukkitServerInterface.java | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/sk89q/bukkit/util/CommandsManagerRegistration.java b/src/main/java/com/sk89q/bukkit/util/CommandsManagerRegistration.java index 5a82822c7..168270c14 100644 --- a/src/main/java/com/sk89q/bukkit/util/CommandsManagerRegistration.java +++ b/src/main/java/com/sk89q/bukkit/util/CommandsManagerRegistration.java @@ -56,18 +56,18 @@ public class CommandsManagerRegistration extends CommandRegistration { for (Command command : registered) { List permissions = null; Method cmdMethod = commands.getMethods().get(null).get(command.aliases()[0]); - Map childMethods = commands.getMethods().get(cmdMethod); + Map 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()); } else if (cmdMethod != null && childMethods != null && childMethods.size() > 0) { - permissions = new ArrayList(); - for (Method m : childMethods.values()) { - if (m.isAnnotationPresent(CommandPermissions.class)) { - permissions.addAll(Arrays.asList(m.getAnnotation(CommandPermissions.class).value())); - } - } - } + permissions = new ArrayList(); + for (Method m : childMethods.values()) { + if (m.isAnnotationPresent(CommandPermissions.class)) { + 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()]))); } diff --git a/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java index 6d3d5e949..03d931ea6 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java @@ -100,18 +100,18 @@ public class BukkitServerInterface extends ServerInterface { for (Command command : commands) { List permissions = null; Method cmdMethod = manager.getMethods().get(null).get(command.aliases()[0]); - Map childMethods = manager.getMethods().get(cmdMethod); + Map 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()); } else if (cmdMethod != null && childMethods != null && childMethods.size() > 0) { - permissions = new ArrayList(); - for (Method m : childMethods.values()) { - if (m.isAnnotationPresent(CommandPermissions.class)) { - permissions.addAll(Arrays.asList(m.getAnnotation(CommandPermissions.class).value())); - } - } - } + permissions = new ArrayList(); + for (Method m : childMethods.values()) { + if (m.isAnnotationPresent(CommandPermissions.class)) { + 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()]))); }