42 enum class VillageVersion : uchar {
44 WorksiteInitEventFix = 1,
52 ::ll::TypedStorage<8, 8, ::Tick> mLastTicked;
53 ::ll::TypedStorage<4, 12, ::BlockPos> mLastSavedPosition;
61 MCAPI
static int const& GOLEM_DEATH_PENALTY();
63 MCAPI
static int const& LARGE_PENALTY();
65 MCAPI
static int const& LARGE_REWARD();
67 MCAPI
static int const& MEDIUM_PENALTY();
69 MCAPI
static int const& SMALL_PENALTY();
71 MCAPI
static int const& SMALL_REWARD();
75 using ClaimedPOIList = ::std::unordered_map<::ActorUniqueID, ::std::array<::std::weak_ptr<::POIInstance>, 3>>;
77 using DwellerMap = ::std::unordered_map<::ActorUniqueID, ::Village::DwellerData>;
79 using DwellerTimestamp = ::std::pair<::ActorUniqueID, ::Tick>;
81 using UnclaimedPOIList = ::std::array<::std::vector<::std::weak_ptr<::POIInstance>>, 3>;
86 ::ll::TypedStorage<8, 16, ::mce::UUID> mUniqueID;
87 ::ll::TypedStorage<8, 8, ::Dimension&> mDimension;
88 ::ll::TypedStorage<8, 72, ::std::array<::std::vector<::std::weak_ptr<::POIInstance>>, 3>> mUnclaimedPOIStacks;
89 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::std::array<::std::weak_ptr<::POIInstance>, 3>>>
91 ::ll::TypedStorage<8, 256, ::std::array<::std::unordered_map<::ActorUniqueID, ::Village::DwellerData>, 4>>
93 ::ll::TypedStorage<4, 24, ::AABB> mBounds;
94 ::ll::TypedStorage<4, 24, ::AABB> mStaticRaidBounds;
95 ::ll::TypedStorage<1, 1, uchar> mVillageVersion;
96 ::ll::TypedStorage<8, 8, ::Tick> mGameTick;
97 ::ll::TypedStorage<8, 8, ::Tick> mSaveTick;
98 ::ll::TypedStorage<8, 8, ::Tick> mRingTick;
99 ::ll::TypedStorage<8, 8, ::Tick> mNoBreedTimer;
100 ::ll::TypedStorage<8, 8, ::Tick> mBadStandingDecayTimer;
101 ::ll::TypedStorage<8, 8, ::Tick> mGoodStandingDecayTimer;
102 ::ll::TypedStorage<8, 8, ::Tick> mPassiveDwellerSpawnTimer;
103 ::ll::TypedStorage<4, 4, int> mInitializationTimer;
104 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, int>> mPlayerStanding;
105 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::Village::DwellerData>> mAggressors;
106 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::ActorUniqueID, ::Tick>>> mVillagerWorkTimestamps;
107 ::ll::TypedStorage<1, 1, bool> mVillageInitialized;
108 ::ll::TypedStorage<8, 48, ::HashedString const> mNitwitFamily;
109 ::ll::TypedStorage<8, 48, ::HashedString const> mVillagePrefix;
110 ::ll::TypedStorage<8, 48, ::HashedString const> mVillagePrefixOld;
111 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Raid>> mRaid;
112 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ActorUniqueID>> mSoundTheAlarmPlayerList;
117 Village& operator=(Village
const&);
118 Village(Village
const&);
126 MCAPI
void _calcPOIDist();
128 MCAPI
void _claimUnclaimedPOIs();
132 MCAPI
void _createRaid();
134 MCAPI
void _deleteOldDataIfNeeded(
::LevelStorage& levelStorage, ::std::string
const& key)
const;
138 MCAPI
bool _findPlayerCentricSpawnPointForRaid(
::Vec3& outSpawnPoint,
bool snapToSurface)
const;
140 MCAPI
bool _findSpawnPointForRaid(
142 float distanceTolerance,
145 bool outsideOfVillage
149 _findSpawnableRegion(
::Vec3 spawnPosition,
int xzSpreadDistance,
bool& outHasSpawnAreaLoaded)
const;
151 MCAPI
void _findWeightedPOI(
152 ::std::vector<::std::weak_ptr<::POIInstance>>& unclaimedPOIStack,
157 MCAPI
void _helpLocateRaiders(
::Raid const& raid);
165 MCAPI
void _playSoundFrom(
::Vec3 const& soundOrigin, ::SharedTypes::Legacy::LevelSoundEvent sound);
167 MCAPI
void _readyRaidGroup(::std::unordered_set<::ActorUniqueID>& spawnedMobs);
173 MCAPI
void _saveVillageDwellers(
::LevelStorage& levelStorage)
const;
179 MCAPI
void _saveVillagePlayerStanding(
::LevelStorage& levelStorage)
const;
183 MCAPI
void _spawnPassiveDwellers(
::BlockSource& region,
int);
186 _spawnRaidGroup(
::Vec3 spawnPosition, uchar groupNumber, ::std::unordered_set<::ActorUniqueID>& spawnedMobs)
const;
188 MCAPI
void _tryAddPoiToVillage(
::ActorUniqueID const& villager, ::std::weak_ptr<::POIInstance> pi);
190 MCAPI
void _tryShiftStandingsTowardNeutral(
::Tick& updateTick, uint64 updateInterval,
bool positiveShift);
192 MCAPI
void _trySpawnDefenderDwellers(
::BlockSource& region, uint64 bedCount);
194 MCAPI
void _updateAndRemoveInactiveDwellers(uint64 villagerPurgeTime,
float villageBorderTolerance);
200 MCAPI
void addActorToVillage(::DwellerRole role,
::ActorUniqueID const& actorID);
202 MCAPI
void addAggressor(
::Mob const& mob);
204 MCAPI
bool addPOI(::std::weak_ptr<::POIInstance> pi);
208 MCAPI
bool checkNeedMoreVillagers()
const;
210 MCAPI
void debugDraw();
212 MCAPI ::std::weak_ptr<::POIInstance> fetchOwnedPOI(
::ActorUniqueID const&
id, ::POIType type);
214 MCAPI uint64 getBedPOICount()
const;
216 MCAPI ::std::weak_ptr<::POIInstance> getClosestPOI(::POIType type,
::BlockPos const& position);
218 MCAPI
bool hasInvalidRole(
::ActorUniqueID const& actorId, ::DwellerRole
const& role);
220 MCAPI
bool hasSpecificDweller(::DwellerRole role,
::ActorUniqueID const&
id)
const;
222 MCAPI
void loadDataByKey(::std::string
const& key,
::CompoundTag const& tag);
226 MCAPI ::std::_List_iterator<
227 ::std::_List_val<::std::_List_simple_types<::std::pair<::ActorUniqueID const, ::Village::DwellerData>>>>
228 removeActorFromVillage(::DwellerRole role,
::ActorUniqueID const& actor);
230 MCAPI
void removeAllInstancesofActorFromVillage(
::ActorUniqueID const& actor);
232 MCAPI
void removeVillageSavedData();
234 MCAPI
void rewardAllPlayers(
int deltaAmount);
238 MCAPI
void tickRaid(
::Tick gameTick);
240 MCAPI
void triggerRaid();
242 MCAPI
void unlinkMismatchedJobsites(
::Actor const& villager);
252 MCAPI static ::std::shared_ptr<::POIInstance> _findPreferredPOI(
253 ::std::vector<::std::weak_ptr<::POIInstance>>& unclaimedPOIStack,
263 MCAPI static ::std::string
const& CELEBRATION_EVENT();
265 MCAPI
static bool& DEBUG_DRAWING();
267 MCAPI static ::Vec3
const& RAID_BOUNDS_PADDING();
269 MCAPI static ::std::string
const& RAID_EXPIRY_EVENT();
271 MCAPI
static int const& RAID_FINISHED_DELAY_IN_TICKS();
273 MCAPI
static int const& RAID_GROUP_COMPLETE_DELAY_IN_TICKS();
275 MCAPI
static int const& RAID_LOCATION_HELP_DELAY_IN_TICKS();
277 MCAPI
static uchar
const& RAID_MAX_SPAWN_FAILURES();
279 MCAPI
static int const& RAID_PREP_TIME_IN_TICKS();
281 MCAPI static ::Tick
const& RAID_TIMEOUT_IN_TICKS();
283 MCAPI static ::std::string
const& STORAGE_KEY_DWELLERS();
285 MCAPI static ::std::string
const& STORAGE_KEY_PLAYERS();
287 MCAPI static ::std::string
const& STORAGE_KEY_POI();
289 MCAPI static ::std::string
const& STORAGE_KEY_PREFIX();
291 MCAPI static ::std::string
const& STORAGE_KEY_RAID();
293 MCAPI static ::std::string
const& STORAGE_KEY_VILLAGE();