use of server.partyquest.mcpq.MCWZData.MCMobGenPos in project HeavenMS by ronancpl.
the class MCBattlefield method getRandomSpawnPos.
private MCMobGenPos getRandomSpawnPos(MCTeam team) {
List<MCMobGenPos> lst = null;
if (this.wzData.mapDivided) {
if (null == team) {
return null;
} else
switch(team) {
case RED:
lst = originalRedSpawns;
break;
case BLUE:
lst = originalBlueSpawns;
break;
default:
return null;
}
} else {
lst = originalUnifiedSpawns;
}
if (lst == null) {
return null;
}
if (lst.isEmpty()) {
return null;
}
int randIndex = (int) Math.floor(Math.random() * lst.size());
return lst.remove(randIndex);
}
Aggregations