Removing badonothing, in favor of an argument on bareload

This commit is contained in:
Ne0n x3r0 2013-02-06 14:22:01 -06:00
parent 58cb889998
commit d4ae745e59
4 changed files with 6 additions and 9 deletions

View File

@ -20,8 +20,5 @@ public class BetterAlias extends JavaPlugin
BetterAliasCommandExecutor betterAliasCommandExecutor = new BetterAliasCommandExecutor(this); BetterAliasCommandExecutor betterAliasCommandExecutor = new BetterAliasCommandExecutor(this);
this.getCommand("bareload").setExecutor(betterAliasCommandExecutor); this.getCommand("bareload").setExecutor(betterAliasCommandExecutor);
//Filler command to null things to since console commands are not cancellable
this.getCommand("badonothing").setExecutor(betterAliasCommandExecutor);
} }
} }

View File

@ -71,7 +71,7 @@ public class BetterAliasCommandListener implements Listener
{ {
if(plugin.aliasManager.sendAliasCommands(alias,e.getSender(),sCommand)) if(plugin.aliasManager.sendAliasCommands(alias,e.getSender(),sCommand))
{ {
e.setCommand("badonothing"); e.setCommand("bareload donothing");
} }
} }
} }

View File

@ -17,14 +17,16 @@ public class BetterAliasCommandExecutor implements CommandExecutor
@Override @Override
public boolean onCommand(CommandSender cs, Command cmnd, String alias, String[] args) public boolean onCommand(CommandSender cs, Command cmnd, String alias, String[] args)
{ {
if(cmnd.getName().equalsIgnoreCase("badonothing")) // To allow nulling server commands out
if(args.length == 1 && args[0].equalsIgnoreCase("donothing"))
{ {
return true; return true;
} }
if(cs.hasPermission("BetterAlias.reload") || cs.isOp()) if(cs.hasPermission("BetterAlias.reload") || cs.isOp())
{ {
cs.sendMessage(ChatColor.GOLD+"Reloading aliases..."); cs.sendMessage(ChatColor.GOLD+"Reloading aliases...");
if(plugin.aliasManager.loadAliases()) if(plugin.aliasManager.loadAliases())

View File

@ -5,9 +5,7 @@ database: false
description: Command alias system description: Command alias system
commands: commands:
bareload: bareload:
description: Reloads the aliases.yml file description: Reloads the aliases.yml file
badonothing:
description: Filler command, since console commands are not cancellable
permissions: permissions:
BetterAlias.reload: BetterAlias.reload:
description: Allows reloading BetterAlias description: Allows reloading BetterAlias