use of com.minecolonies.api.colony.ICivilianData in project minecolonies by ldtteam.
the class ReproductionManager method checkForBioParents.
/**
* Check if there are potential biological parents in the colony.
* (At least one male/female citizen).
* @return true if so.
*/
private boolean checkForBioParents() {
boolean hasMale = false;
boolean hasFemale = false;
for (final ICitizenData data : colony.getCitizenManager().getCitizens()) {
if (data.isFemale()) {
hasFemale = true;
} else {
hasMale = true;
}
if (hasFemale && hasMale) {
return true;
}
}
for (final ICivilianData data : colony.getVisitorManager().getCivilianDataMap().values()) {
if (data.isFemale()) {
hasFemale = true;
} else {
hasMale = true;
}
if (hasFemale && hasMale) {
return true;
}
}
return false;
}
use of com.minecolonies.api.colony.ICivilianData in project minecolonies by Minecolonies.
the class ReproductionManager method checkForBioParents.
/**
* Check if there are potential biological parents in the colony.
* (At least one male/female citizen).
* @return true if so.
*/
private boolean checkForBioParents() {
boolean hasMale = false;
boolean hasFemale = false;
for (final ICitizenData data : colony.getCitizenManager().getCitizens()) {
if (data.isFemale()) {
hasFemale = true;
} else {
hasMale = true;
}
if (hasFemale && hasMale) {
return true;
}
}
for (final ICivilianData data : colony.getVisitorManager().getCivilianDataMap().values()) {
if (data.isFemale()) {
hasFemale = true;
} else {
hasMale = true;
}
if (hasFemale && hasMale) {
return true;
}
}
return false;
}
use of com.minecolonies.api.colony.ICivilianData in project AdvancedPeripherals by Seniorendi.
the class ColonyPeripheral method getVisitors.
@LuaFunction(mainThread = true)
public final Object getVisitors() throws LuaException {
IColony colony = getColony();
List<Object> list = new ArrayList<>();
for (ICivilianData civilian : colony.getVisitorManager().getCivilianDataMap().values()) {
if (!(civilian instanceof IVisitorData))
continue;
list.add(MineColonies.visitorToObject((IVisitorData) civilian));
}
return list;
}
Aggregations