Search in sources :

Example 1 with MCMobGenPos

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);
}
Also used : MCMobGenPos(server.partyquest.mcpq.MCWZData.MCMobGenPos) SpawnPoint(server.life.SpawnPoint)

Aggregations

SpawnPoint (server.life.SpawnPoint)1 MCMobGenPos (server.partyquest.mcpq.MCWZData.MCMobGenPos)1