40 enum class VillageVersion : uchar {
42 WorksiteInitEventFix = 1,
50 ::ll::TypedStorage<8, 8, ::Tick> mLastTicked;
51 ::ll::TypedStorage<4, 12, ::BlockPos> mLastSavedPosition;
57 using ClaimedPOIList = ::std::unordered_map<::ActorUniqueID, ::std::array<::std::weak_ptr<::POIInstance>, 3>>;
59 using DwellerMap = ::std::unordered_map<::ActorUniqueID, ::Village::DwellerData>;
61 using DwellerTimestamp = ::std::pair<::ActorUniqueID, ::Tick>;
63 using UnclaimedPOIList = ::std::array<::std::vector<::std::weak_ptr<::POIInstance>>, 3>;
68 ::ll::TypedStorage<8, 16, ::mce::UUID> mUniqueID;
69 ::ll::TypedStorage<8, 8, ::Dimension&> mDimension;
70 ::ll::TypedStorage<8, 72, ::std::array<::std::vector<::std::weak_ptr<::POIInstance>>, 3>> mUnclaimedPOIStacks;
71 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::std::array<::std::weak_ptr<::POIInstance>, 3>>>
73 ::ll::TypedStorage<8, 256, ::std::array<::std::unordered_map<::ActorUniqueID, ::Village::DwellerData>, 4>>
75 ::ll::TypedStorage<4, 24, ::AABB> mBounds;
76 ::ll::TypedStorage<4, 24, ::AABB> mStaticRaidBounds;
77 ::ll::TypedStorage<1, 1, uchar> mVillageVersion;
78 ::ll::TypedStorage<8, 8, ::Tick> mGameTick;
79 ::ll::TypedStorage<8, 8, ::Tick> mSaveTick;
80 ::ll::TypedStorage<8, 8, ::Tick> mRingTick;
81 ::ll::TypedStorage<8, 8, ::Tick> mNoBreedTimer;
82 ::ll::TypedStorage<8, 8, ::Tick> mBadStandingDecayTimer;
83 ::ll::TypedStorage<8, 8, ::Tick> mGoodStandingDecayTimer;
84 ::ll::TypedStorage<8, 8, ::Tick> mPassiveDwellerSpawnTimer;
85 ::ll::TypedStorage<4, 4, int> mInitializationTimer;
86 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, int>> mPlayerStanding;
87 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::Village::DwellerData>> mAggressors;
88 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::ActorUniqueID, ::Tick>>> mVillagerWorkTimestamps;
89 ::ll::TypedStorage<1, 1, bool> mVillageInitialized;
90 ::ll::TypedStorage<8, 48, ::HashedString const> mNitwitFamily;
91 ::ll::TypedStorage<8, 48, ::HashedString const> mVillagePrefix;
92 ::ll::TypedStorage<8, 48, ::HashedString const> mVillagePrefixOld;
93 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Raid>> mRaid;
94 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ActorUniqueID>> mSoundTheAlarmPlayerList;
99 Village& operator=(Village
const&);
100 Village(Village
const&);
108 MCAPI
void _calcPOIDist();
112 MCAPI
void _createRaid();
114 MCAPI
bool _findSpawnPointForRaid(
116 float const distanceTolerance,
117 float const boundsScaling,
119 bool outsideOfVillage
123 _findSpawnableRegion(
::Vec3 spawnPosition,
int xzSpreadDistance,
bool& outHasSpawnAreaLoaded)
const;
125 MCAPI
void _playSoundFrom(
::Vec3 const& soundOrigin, ::SharedTypes::Legacy::LevelSoundEvent sound);
129 MCAPI
void _saveVillageDwellers(
::LevelStorage& levelStorage)
const;
133 MCAPI
void _saveVillagePlayerStanding(
::LevelStorage& levelStorage)
const;
137 MCAPI
void _tryAddPoiToVillage(
::ActorUniqueID const& villager, ::std::weak_ptr<::POIInstance> pi);
139 MCAPI
void addActorToVillage(::DwellerRole role,
::ActorUniqueID const& actorID);
141 MCAPI
bool addPOI(::std::weak_ptr<::POIInstance> pi);
145 MCAPI
bool checkNeedMoreVillagers()
const;
147 MCAPI ::std::weak_ptr<::POIInstance> fetchOwnedPOI(
::ActorUniqueID const&
id, ::POIType type);
149 MCAPI
void fireSoundTheAlarm();
151 MCAPI ::Actor* getClosestAggressor(
::Actor* from);
153 MCAPI ::Player* getClosestBadStandingPlayer(
::Actor& from);
155 MCAPI ::std::weak_ptr<::POIInstance> getClosestPOI(::POIType type,
::BlockPos const& position);
157 MCAPI
bool hasInvalidRole(
::ActorUniqueID const& actorId, ::DwellerRole
const& role);
159 MCAPI
bool hasSpecificDweller(::DwellerRole role,
::ActorUniqueID const&
id)
const;
163 MCAPI ::std::_List_iterator<
164 ::std::_List_val<::std::_List_simple_types<::std::pair<::ActorUniqueID const, ::Village::DwellerData>>>>
165 removeActorFromVillage(::DwellerRole role,
::ActorUniqueID const& actor);
167 MCAPI
void removeAllInstancesofActorFromVillage(
::ActorUniqueID const& actor);
169 MCAPI ::std::_List_iterator<
170 ::std::_List_val<::std::_List_simple_types<::std::pair<::ActorUniqueID const, ::Village::DwellerData>>>>
173 MCAPI
void resetDwellerTimer(::DwellerRole role,
::ActorUniqueID const&
id);
179 MCAPI
void triggerRaid();
183 MCAPI
void unlinkMismatchedJobsites(
::Actor const& villager);
201 MCAPI static ::std::string
const& CELEBRATION_EVENT();
203 MCAPI static ::std::string
const& RAID_EXPIRY_EVENT();
205 MCAPI static ::std::string
const& STORAGE_KEY_PREFIX();