mirror of
https://github.com/taoneill/war.git
synced 2024-11-05 18:22:22 +01:00
Remove broken getZoneByTeam logic
- Replaced with warzone getter on Team objects - Should close #704
This commit is contained in:
parent
97646becc3
commit
df85b176b7
@ -80,6 +80,10 @@ public class Team {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Warzone getZone() {
|
||||||
|
return this.warzone;
|
||||||
|
}
|
||||||
|
|
||||||
public TeamKind getKind() {
|
public TeamKind getKind() {
|
||||||
return this.kind;
|
return this.kind;
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,7 @@ public class War extends JavaPlugin {
|
|||||||
if (loadout == null) {
|
if (loadout == null) {
|
||||||
// Check if any loadouts exist, if not gotta use the default inventories then add the newly created one
|
// Check if any loadouts exist, if not gotta use the default inventories then add the newly created one
|
||||||
if(!team.getInventories().hasLoadouts()) {
|
if(!team.getInventories().hasLoadouts()) {
|
||||||
Warzone warzone = Warzone.getZoneByTeam(team);
|
Warzone warzone = team.getZone();
|
||||||
for (String key : warzone.getDefaultInventories().resolveLoadouts().keySet()) {
|
for (String key : warzone.getDefaultInventories().resolveLoadouts().keySet()) {
|
||||||
HashMap<Integer, ItemStack> transferredLoadout = warzone.getDefaultInventories().resolveLoadouts().get(key);
|
HashMap<Integer, ItemStack> transferredLoadout = warzone.getDefaultInventories().resolveLoadouts().get(key);
|
||||||
if (transferredLoadout != null) {
|
if (transferredLoadout != null) {
|
||||||
|
@ -169,18 +169,6 @@ public class Warzone {
|
|||||||
return null;
|
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() {
|
public boolean ready() {
|
||||||
if (this.volume.hasTwoCorners() && !this.volume.tooSmall() && !this.volume.tooBig()) {
|
if (this.volume.hasTwoCorners() && !this.volume.tooSmall() && !this.volume.tooBig()) {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user