use of com.minecolonies.coremod.colony.CitizenData in project minecolonies by Minecolonies.
the class BuildingHome method readFromNBT.
@Override
public void readFromNBT(@NotNull final NBTTagCompound compound) {
super.readFromNBT(compound);
residents.clear();
final int[] residentIds = compound.getIntArray(TAG_RESIDENTS);
for (final int citizenId : residentIds) {
final CitizenData citizen = getColony().getCitizen(citizenId);
if (citizen != null) {
// Bypass addResident (which marks dirty)
residents.add(citizen);
citizen.setHomeBuilding(this);
}
}
}
Aggregations