Minor Fixes to some commands

This commit is contained in:
Eric Stokes 2011-07-10 08:40:06 -06:00
parent b6d718a0ba
commit c54a746c2f
3 changed files with 11 additions and 5 deletions

View File

@ -8,6 +8,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.nijiko.permissions.PermissionHandler;
import com.nijikokun.bukkit.Permissions.Permissions;
import com.pneumaticraft.commandhandler.PermissionsInterface;
public class MVPermissions implements PermissionsInterface {
@ -24,7 +25,7 @@ public class MVPermissions implements PermissionsInterface {
this.plugin = plugin;
// We have to see if permissions was loaded before MV was
if (this.plugin.getServer().getPluginManager().getPlugin("Permissions") != null) {
this.setPermissions(((com.nijikokun.bukkit.Permissions.Permissions) this.plugin.getServer().getPluginManager().getPlugin("Permissions")).getHandler());
this.setPermissions(((Permissions) this.plugin.getServer().getPluginManager().getPlugin("Permissions")).getHandler());
this.plugin.log(Level.INFO, "- Attached to Permissions");
}
}
@ -71,7 +72,6 @@ public class MVPermissions implements PermissionsInterface {
List<String> blackList = this.plugin.getMVWorld(w.getName()).getPlayerBlacklist();
boolean returnValue = true;
// I lied. You definitely want this. Sorry Rigby :( You were right. --FF
// If there's anyone in the whitelist, then the whitelist is ACTIVE, anyone not in it is blacklisted.
if (whiteList.size() > 0) {
returnValue = false;

View File

@ -5,13 +5,14 @@ import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.pneumaticraft.commandhandler.Command;
public class HelpCommand extends Command {
private static final int CMDS_PER_PAGE = 10;
private static final int CMDS_PER_PAGE = 8;
public HelpCommand(JavaPlugin plugin) {
super(plugin);
@ -53,8 +54,13 @@ public class HelpCommand extends Command {
private void showPage(int page, CommandSender sender, List<Command> cmds) {
int start = (page - 1) * CMDS_PER_PAGE;
int end = start + CMDS_PER_PAGE;
for (int i = start; i < cmds.size() && i < end; i++) {
for (int i = start; i < end; i++) {
// For consistancy, print some extra lines if it's a player:
if (i < cmds.size()) {
sender.sendMessage(ChatColor.AQUA + cmds.get(i).getCommandUsage());
} else if(sender instanceof Player) {
sender.sendMessage(" ");
}
}
}

View File

@ -17,7 +17,7 @@ public class InfoCommand extends Command {
super(plugin);
this.commandName = "World Information";
this.commandDesc = "Returns detailed information on the world.";
this.commandUsage = "/mvinfo" + ChatColor.GOLD + "[WORLD]" + ChatColor.DARK_PURPLE + "<Page #>";
this.commandUsage = "/mvinfo" + ChatColor.GOLD + " [WORLD] " + ChatColor.DARK_PURPLE + " <Page #>";
this.minimumArgLength = 0;
this.maximumArgLength = 2;
this.commandKeys.add("mvinfo");