Move the filtering of commands out of the Handler

This commit is contained in:
Eric Stokes 2011-07-10 14:23:44 -06:00
parent 8e92496fb9
commit 91802f0e55
2 changed files with 8 additions and 2 deletions

@ -1 +1 @@
Subproject commit a7cbc0f047c8ef06216ea45e1966e0c0914f2658
Subproject commit b555fd75d72ded08ae4f78e014ff3ed73759ac06

View File

@ -1,6 +1,7 @@
// This file is no longer licensed under that silly CC license. I have blanked it out and will start implementaiton of my own in a few days. For now there is no help.
package com.onarandombox.MultiverseCore.command.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
@ -38,7 +39,12 @@ public class HelpCommand extends Command {
}
}
List<Command> availableCommands = ((MultiverseCore) this.plugin).getCommandHandler().getCommands(sender);
List<Command> availableCommands = new ArrayList<Command> (((MultiverseCore) this.plugin).getCommandHandler().getAllCommands());
for(Command c : availableCommands) {
if(!((MultiverseCore) this.plugin).getPermissions().hasPermission(sender, c.getPermission(), c.isOpRequired())) {
availableCommands.remove(c);
}
}
int totalPages = (int) Math.ceil(availableCommands.size() / ( CMDS_PER_PAGE + 0.0));
if (page > totalPages) {