town populator tweaks
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2025-05-30 15:14:27 -04:00
parent dcbe1aa4bc
commit 69234adb60
2 changed files with 7 additions and 4 deletions

View File

@ -3,6 +3,7 @@ package electrosphere.server.macro.civilization.town;
import electrosphere.engine.Globals;
import electrosphere.server.macro.MacroData;
import electrosphere.server.macro.character.Character;
import electrosphere.server.macro.character.CharacterUtils;
import electrosphere.server.macro.civilization.Civilization;
import electrosphere.server.macro.region.MacroRegion;
import electrosphere.server.macro.spatial.MacroAreaObject;
@ -127,6 +128,7 @@ public class Town implements MacroAreaObject, MacroLODObject {
*/
public void addResident(Character resident){
residents.add(resident.getId());
CharacterUtils.addHometown(resident, this);
}
/**

View File

@ -34,12 +34,13 @@ public class TownPopulator {
Character chara = Globals.serverState.characterService.createCharacter(template, CharacterService.NO_PLAYER);
Race.setRace(chara, Globals.gameConfigCurrent.getRaceMap().getRace("human"));
CharacterUtils.addShelter(chara, struct);
CharacterUtils.addHometown(chara, town);
town.addResident(chara);
chara.setPos(new Vector3d(struct.getPos()).add(1,1,1));
if(rand.nextInt(5) == 0){
}
}
}
//assign jobs to created characters
// int farmPlots = town.getFarmPlots(macroData).size(); ~250
// int popCount = town.getResidents(macroData).size(); ~15
}
}