Added substing matching for zones.

This commit is contained in:
taoneill 2011-03-06 23:20:45 -05:00
parent 13955e1ca0
commit e3f7dd1989
4 changed files with 7 additions and 2 deletions

View File

@ -1002,7 +1002,7 @@ public class War extends JavaPlugin {
} else {
boolean warped = false;
for(Warzone warzone : this.getWarzones()) {
if(warzone.getName().equals(arguments[0]) && warzone.getTeleport() != null){
if(warzone.getName().toLowerCase().startsWith(arguments[0]) && warzone.getTeleport() != null){
Team playerTeam = getPlayerTeam(player.getName());
if(playerTeam != null) {
Warzone playerWarzone = getPlayerTeamWarzone(player.getName());
@ -1011,6 +1011,7 @@ public class War extends JavaPlugin {
player.teleportTo(warzone.getTeleport());
}
warped = true;
break;
}
}
if(!warped) {

View File

@ -923,6 +923,9 @@ public class Warzone {
Team playerTeam = war.getPlayerTeam(player.getName());
if(playerTeam !=null) {
if(removeFromTeam) playerTeam.removePlayer(player.getName());
for(Team t : this.getTeams()) {
t.teamcast(player.getName() + " left the zone.");
}
playerTeam.resetSign();
if(this.isFlagThief(player.getName())) {
Team victim = this.getVictimTeamForThief(player.getName());

View File

@ -268,7 +268,7 @@ public class ZoneLobby {
for(int doorIndex = 0; doorIndex < warzone.getTeams().size(); doorIndex++) {
// 0 at center, 1 to the left, 2 to the right, 3 to the left, etc
Team team = warzone.getTeams().get(doorIndex);
if(team.getPlayers().size() % 2 == 0) {
if(warzone.getTeams().size() % 2 == 0) {
// even number of teams
if(doorIndex % 2 == 0) {
teamGateBlocks.put(team.getName(), new BlockInfo(lobbyMiddleWallBlock.getFace(rightSide, doorIndex * 2 + 2)));

View File

@ -88,6 +88,7 @@ public class Volume {
if(sign.getLines() != null) {
this.getSignLines().put("sign-" + i + "-" + j + "-" + k, sign.getLines());
}
} else if(state instanceof Chest) {
// Chests
Chest chest = (Chest)state;