From 93fbad4d823ef8e3780296d6becbe758a325fc70 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Mon, 29 Aug 2011 14:15:25 -0700 Subject: [PATCH] Cleaned up CommandAlias a bit --- .../util/commands/{AliasCommand.java => CommandAlias.java} | 6 +++--- .../com/sk89q/minecraft/util/commands/CommandsManager.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) rename src/main/java/com/sk89q/minecraft/util/commands/{AliasCommand.java => CommandAlias.java} (91%) diff --git a/src/main/java/com/sk89q/minecraft/util/commands/AliasCommand.java b/src/main/java/com/sk89q/minecraft/util/commands/CommandAlias.java similarity index 91% rename from src/main/java/com/sk89q/minecraft/util/commands/AliasCommand.java rename to src/main/java/com/sk89q/minecraft/util/commands/CommandAlias.java index 134d1c952..658c08698 100644 --- a/src/main/java/com/sk89q/minecraft/util/commands/AliasCommand.java +++ b/src/main/java/com/sk89q/minecraft/util/commands/CommandAlias.java @@ -1,6 +1,6 @@ // $Id$ /* - * Copyright (C) 2010 sk89q + * Copyright (C) 2011 sk89q * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,11 +30,11 @@ import java.lang.annotation.RetentionPolicy; */ @Retention(RetentionPolicy.RUNTIME) -public @interface AliasCommand { +public @interface CommandAlias { /** * * @return Raw {@link CommandsManager}-formatted command arg array to run */ - String[] aliasTo(); + String[] value(); } diff --git a/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java b/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java index b4153d47f..0f37fd427 100644 --- a/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java +++ b/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java @@ -369,9 +369,9 @@ public abstract class CommandsManager { } else { executeMethod(method, args, player, methodArgs, level + 1); } - } else if (method.isAnnotationPresent(AliasCommand.class)) { - AliasCommand aCmd = method.getAnnotation(AliasCommand.class); - executeMethod(parent, aCmd.aliasTo(), player, methodArgs, level); + } else if (method.isAnnotationPresent(CommandAlias.class)) { + CommandAlias aCmd = method.getAnnotation(CommandAlias.class); + executeMethod(parent, aCmd.value(), player, methodArgs, level); } else { Command cmd = method.getAnnotation(Command.class);