Use this.msg

This commit is contained in:
Tim Düsterhus 2011-07-27 21:14:26 +02:00
parent 50ebc9ad0c
commit 736f270a4a
5 changed files with 20 additions and 20 deletions

View File

@ -24,7 +24,7 @@ public class JoinCommand extends AbstractWarCommand {
Player player = (Player) this.sender;
if (!War.war.canPlayWar(player)) {
this.sender.sendMessage("Cannot play war");
this.msg("Cannot play war");
return true;
}
@ -74,7 +74,7 @@ public class JoinCommand extends AbstractWarCommand {
TeamKind kind = TeamKinds.teamKindFromString(this.args[0]);
if (zone.isDisabled()) {
this.sender.sendMessage("This warzone is disabled.");
this.msg("This warzone is disabled.");
} else {
List<Team> teams = zone.getTeams();
boolean foundTeam = false;
@ -82,7 +82,7 @@ public class JoinCommand extends AbstractWarCommand {
if (team.getName().startsWith(name) || team.getKind() == kind) {
if (!zone.hasPlayerInventory(player.getName())) {
zone.keepPlayerInventory(player);
this.sender.sendMessage("Your inventory is in storage until you /leave.");
this.msg("Your inventory is in storage until you /leave.");
}
if (team.getPlayers().size() < zone.getTeamCap()) {
team.addPlayer(player);
@ -93,7 +93,7 @@ public class JoinCommand extends AbstractWarCommand {
}
foundTeam = true;
} else {
this.sender.sendMessage("Team " + team.getName() + " is full.");
this.msg("Team " + team.getName() + " is full.");
foundTeam = true;
}
}
@ -104,7 +104,7 @@ public class JoinCommand extends AbstractWarCommand {
team.teamcast("" + player.getName() + " joined " + team.getName());
}
} else {
this.sender.sendMessage("No such team. Try /teams.");
this.msg("No such team. Try /teams.");
}
}
return true;

View File

@ -32,7 +32,7 @@ public class TeamsCommand extends AbstractWarCommand {
return false;
}
this.sender.sendMessage(zone.getTeamInformation());
this.msg(zone.getTeamInformation());
return true;
}

View File

@ -18,9 +18,9 @@ public class WarhubCommand extends AbstractWarCommand {
Player player = (Player) this.sender;
if (War.war.getWarHub() == null) {
War.war.badMsg(player, "No warhub on this War server. Try /zones and /zone.");
this.msg("No warhub on this War server. Try /zones and /zone.");
} else if (!War.war.canWarp(player)) {
War.war.badMsg(player, "Can't warp to warhub. You need the 'war.warp' permission.");
this.msg("Can't warp to warhub. You need the 'war.warp' permission.");
} else {
Warzone playerWarzone = Warzone.getZoneByPlayerName(player.getName());
if (playerWarzone != null) { // was in zone

View File

@ -22,20 +22,20 @@ public class WarzoneCommand extends AbstractWarCommand {
// handle missing warzone-name
return false;
} else if (!War.war.canWarp(player)) {
this.sender.sendMessage("Can't warp to zone. You need the 'war.warp' permission.");
this.msg("Can't warp to zone. You need the 'war.warp' permission.");
} else {
for (Warzone warzone : War.war.getWarzones()) {
if (warzone.getName().toLowerCase().startsWith(this.args[0].toLowerCase()) && warzone.getTeleport() != null) {
Warzone playerWarzone = Warzone.getZoneByPlayerName(player.getName());
if (playerWarzone != null) {
playerWarzone.handlePlayerLeave(player, warzone.getTeleport(), true);
} else {
player.teleport(warzone.getTeleport());
}
return true;
Warzone warzone = Warzone.getZoneByName(this.args[0]);
if (warzone.getTeleport() != null) {
Warzone playerWarzone = Warzone.getZoneByPlayerName(player.getName());
if (playerWarzone != null) {
playerWarzone.handlePlayerLeave(player, warzone.getTeleport(), true);
} else {
player.teleport(warzone.getTeleport());
}
return true;
}
this.sender.sendMessage("No such warzone.");
this.msg("No such warzone.");
}
return true;
}

View File

@ -35,7 +35,7 @@ public class WarzonesCommand extends AbstractWarCommand {
}
}
this.sender.sendMessage(warzonesMessage + ((this.sender instanceof Player) ? " Use /zone <zone-name> to teleport to a warzone." : ""));
this.msg(warzonesMessage + ((this.sender instanceof Player) ? " Use /zone <zone-name> to teleport to a warzone." : ""));
return true;
}