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);
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))
{
e.setCommand("badonothing");
e.setCommand("bareload donothing");
}
}
}

View File

@ -17,14 +17,16 @@ public class BetterAliasCommandExecutor implements CommandExecutor
@Override
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;
}
if(cs.hasPermission("BetterAlias.reload") || cs.isOp())
{
cs.sendMessage(ChatColor.GOLD+"Reloading aliases...");
if(plugin.aliasManager.loadAliases())

View File

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