Remove broken getZoneByTeam logic

- Replaced with warzone getter on Team objects
- Should close #704
This commit is contained in:
taoneill 2013-11-17 23:34:31 -05:00
parent 97646becc3
commit df85b176b7
3 changed files with 5 additions and 13 deletions

View File

@ -79,6 +79,10 @@ public class Team {
}
return null;
}
public Warzone getZone() {
return this.warzone;
}
public TeamKind getKind() {
return this.kind;

View File

@ -428,7 +428,7 @@ public class War extends JavaPlugin {
if (loadout == null) {
// Check if any loadouts exist, if not gotta use the default inventories then add the newly created one
if(!team.getInventories().hasLoadouts()) {
Warzone warzone = Warzone.getZoneByTeam(team);
Warzone warzone = team.getZone();
for (String key : warzone.getDefaultInventories().resolveLoadouts().keySet()) {
HashMap<Integer, ItemStack> transferredLoadout = warzone.getDefaultInventories().resolveLoadouts().get(key);
if (transferredLoadout != null) {

View File

@ -169,18 +169,6 @@ public class Warzone {
return null;
}
public static Warzone getZoneByTeam(Team team) {
for (Warzone warzone : War.war.getWarzones()) {
for (Team teamToCheck : warzone.getTeams()) {
if (teamToCheck.getName().equals(team.getName())) {
return warzone;
}
}
}
return null;
}
public boolean ready() {
if (this.volume.hasTwoCorners() && !this.volume.tooSmall() && !this.volume.tooBig()) {
return true;