From 29483e928e3d4cc86773a844f15bd27f7c060d5d Mon Sep 17 00:00:00 2001 From: Morgan Date: Mon, 18 Jul 2011 12:34:54 -0400 Subject: [PATCH] Rename commands to 'vault-info' and 'vault-reload' to allow others to use 'vault' for other purposes. --- plugin.yml | 12 ++++++++---- src/net/milkbowl/vault/Vault.java | 25 +++++++++++-------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/plugin.yml b/plugin.yml index 59f3aae..a3becb2 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,11 +1,15 @@ name: Vault main: net.milkbowl.vault.Vault -version: 1.0.0dev +version: 1.0.0dev1 author: Cereal description: > Abstraction Library for Bukkit Plugins commands: - vault: - description: Generic command for Vault API + vault-info: + description: Displays information about Vault usage: | - / - displays vault command help \ No newline at end of file + / - Displays Vault information + vault-reload: + description: Reloads Vault + usage: | + / - Reloads Vault \ No newline at end of file diff --git a/src/net/milkbowl/vault/Vault.java b/src/net/milkbowl/vault/Vault.java index 4b073f0..eb1dc91 100644 --- a/src/net/milkbowl/vault/Vault.java +++ b/src/net/milkbowl/vault/Vault.java @@ -64,7 +64,8 @@ public class Vault extends JavaPlugin { loadEconomy(); loadPermission(); - getCommand("vault").setExecutor(this); + getCommand("vault-info").setExecutor(this); + getCommand("vault-reload").setExecutor(this); log.info(String.format("[%s] Enabled Version %s", getDescription().getName(), getDescription().getVersion())); } @@ -204,19 +205,15 @@ public class Vault extends JavaPlugin { return true; } - if(command.getLabel().equals("vault")) { - if(args.length > 0) { - if(args[0].equalsIgnoreCase("info")) { - sender.sendMessage(String.format("[%s] Vault v%s Information", getDescription().getName(), getDescription().getVersion())); - sender.sendMessage(String.format("[%s] Economy: %s", getDescription().getName(), getEconomy().getName())); - sender.sendMessage(String.format("[%s] Permission: %s", getDescription().getName(), getPermission().getName())); - return true; - } else if(args[0].equalsIgnoreCase("reload")) { - reload(); - sender.sendMessage(String.format("[%s] Reloaded Addons", getDescription().getName())); - return true; - } - } + if (command.getLabel().equals("vault-info")) { + sender.sendMessage(String.format("[%s] Vault v%s Information", getDescription().getName(), getDescription().getVersion())); + sender.sendMessage(String.format("[%s] Economy: %s", getDescription().getName(), getEconomy().getName())); + sender.sendMessage(String.format("[%s] Permission: %s", getDescription().getName(), getPermission().getName())); + return true; + } else if (command.getLabel().equals("vault-reload")) { + reload(); + sender.sendMessage(String.format("[%s] Reloaded Addons", getDescription().getName())); + return true; } // Show help