Fixed setzonelobby not working for detaching lobbies: copy-pasta = bad. Hooked up warhub command.

This commit is contained in:
taoneill 2011-08-06 17:00:51 -04:00
parent 05b827d265
commit 6dfb485ec2
4 changed files with 6 additions and 15 deletions

View File

@ -1,10 +0,0 @@
package bukkit.tommytony.war;
public class NoZoneMakerException extends Exception {
/**
*
*/
private static final long serialVersionUID = -5412011034665080340L;
}

View File

@ -48,7 +48,9 @@ public class WarCommandHandler {
AbstractWarCommand commandObj = null; AbstractWarCommand commandObj = null;
try { try {
if (command.equals("zones") || command.equals("warzones")) { if (command.equals("warhub")) {
commandObj = new WarhubCommand(this, sender, arguments);
} else if (command.equals("zones") || command.equals("warzones")) {
commandObj = new WarzonesCommand(this, sender, arguments); commandObj = new WarzonesCommand(this, sender, arguments);
} else if (command.equals("zone") || command.equals("warzone")) { } else if (command.equals("zone") || command.equals("warzone")) {
commandObj = new WarzoneCommand(this, sender, arguments); commandObj = new WarzoneCommand(this, sender, arguments);

View File

@ -30,11 +30,10 @@ public class SetZoneLobbyCommand extends AbstractZoneMakerCommand {
Warzone zone = Warzone.getZoneByLocation((Player) this.getSender()); Warzone zone = Warzone.getZoneByLocation((Player) this.getSender());
if (zone == null) { if (zone == null) {
ZoneLobby lobby = ZoneLobby.getLobbyByLocation((Player) this.getSender()); ZoneLobby lobby = ZoneLobby.getLobbyByLocation((Player) this.getSender());
if (lobby == null) { if (lobby != null) {
return false;
}
zone = lobby.getZone(); zone = lobby.getZone();
} }
}
if (zone == null) { if (zone == null) {
Warzone givenWarzone = Warzone.getZoneByName(this.args[0]); Warzone givenWarzone = Warzone.getZoneByName(this.args[0]);

View File

@ -35,7 +35,7 @@ public class WarzonesCommand extends AbstractWarCommand {
for (Team team : warzone.getTeams()) { for (Team team : warzone.getTeams()) {
playerTotal += team.getPlayers().size(); playerTotal += team.getPlayers().size();
} }
warzonesMessage += playerTotal + " players)"; warzonesMessage += playerTotal + " players) ";
} }
} }