47 MCAPI
static int const& GOLEM_DEATH_PENALTY();
49 MCAPI
static int const& LARGE_PENALTY();
51 MCAPI
static int const& LARGE_REWARD();
53 MCAPI
static int const& MEDIUM_PENALTY();
55 MCAPI
static int const& SMALL_PENALTY();
57 MCAPI
static int const& SMALL_REWARD();
61 enum class VillageVersion : uchar {
63 WorksiteInitEventFix = 1,
71 ::ll::TypedStorage<8, 8, ::Tick> mLastTicked;
72 ::ll::TypedStorage<4, 12, ::BlockPos> mLastSavedPosition;
76 using UnclaimedPOIList = ::std::array<::std::vector<::std::weak_ptr<::POIInstance>>, 3>;
78 using DwellerMap = ::std::unordered_map<::ActorUniqueID, ::Village::DwellerData>;
80 using ClaimedPOIList = ::std::unordered_map<::ActorUniqueID, ::std::array<::std::weak_ptr<::POIInstance>, 3>>;
82 using DwellerTimestamp = ::std::pair<::ActorUniqueID, ::Tick>;
87 ::ll::TypedStorage<8, 16, ::mce::UUID> mUniqueID;
88 ::ll::TypedStorage<8, 8, ::Dimension&> mDimension;
89 ::ll::TypedStorage<8, 72, ::std::array<::std::vector<::std::weak_ptr<::POIInstance>>, 3>> mUnclaimedPOIStacks;
90 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::std::array<::std::weak_ptr<::POIInstance>, 3>>>
92 ::ll::TypedStorage<8, 256, ::std::array<::std::unordered_map<::ActorUniqueID, ::Village::DwellerData>, 4>>
94 ::ll::TypedStorage<4, 24, ::AABB> mBounds;
95 ::ll::TypedStorage<4, 24, ::AABB> mStaticRaidBounds;
96 ::ll::TypedStorage<1, 1, uchar> mVillageVersion;
97 ::ll::TypedStorage<8, 8, ::Tick> mGameTick;
98 ::ll::TypedStorage<8, 8, ::Tick> mSaveTick;
99 ::ll::TypedStorage<8, 8, ::Tick> mRingTick;
100 ::ll::TypedStorage<8, 8, ::Tick> mNoBreedTimer;
101 ::ll::TypedStorage<8, 8, ::Tick> mBadStandingDecayTimer;
102 ::ll::TypedStorage<8, 8, ::Tick> mGoodStandingDecayTimer;
103 ::ll::TypedStorage<8, 8, ::Tick> mPassiveDwellerSpawnTimer;
104 ::ll::TypedStorage<4, 4, int> mInitializationTimer;
105 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, int>> mPlayerStanding;
106 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::Village::DwellerData>> mAggressors;
107 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::ActorUniqueID, ::Tick>>> mVillagerWorkTimestamps;
108 ::ll::TypedStorage<1, 1, bool> mVillageInitialized;
109 ::ll::TypedStorage<8, 48, ::HashedString const> mNitwitFamily;
110 ::ll::TypedStorage<8, 48, ::HashedString const> mVillagePrefix;
111 ::ll::TypedStorage<8, 48, ::HashedString const> mVillagePrefixOld;
112 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Raid>> mRaid;
113 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ActorUniqueID>> mSoundTheAlarmPlayerList;
121 MCAPI
void _calcPOIDist();
123 MCAPI
void _claimUnclaimedPOIs();
127 MCAPI
void _createRaid();
131 MCAPI
bool _findPlayerCentricSpawnPointForRaid(
::Vec3& outSpawnPoint,
bool snapToSurface)
const;
133 MCAPI
bool _findSpawnPointForRaid(
135 float distanceTolerance,
138 bool outsideOfVillage
142 _findSpawnableRegion(
::Vec3 spawnPosition,
int xzSpreadDistance,
bool& outHasSpawnAreaLoaded)
const;
144 MCAPI
void _findWeightedPOI(
145 ::std::vector<::std::weak_ptr<::POIInstance>>& unclaimedPOIStack,
150 MCAPI
void _helpLocateRaiders(
::Raid const& raid);
158 MCAPI
void _playSoundFrom(
::Vec3 const& soundOrigin, ::SharedTypes::Legacy::LevelSoundEvent sound);
160 MCAPI
void _readyRaidGroup(::std::unordered_set<::ActorUniqueID>& spawnedMobs);
166 MCAPI
void _saveVillageDwellers(
::LevelStorage& levelStorage)
const;
172 MCAPI
void _saveVillagePlayerStanding(
::LevelStorage& levelStorage)
const;
176 MCAPI
void _sendSoundTheAlarmAchievement(
::Player const& player)
const;
178 MCAPI
void _spawnPassiveDwellers(
::BlockSource& region,
int);
181 _spawnRaidGroup(
::Vec3 spawnPosition, uchar groupNumber, ::std::unordered_set<::ActorUniqueID>& spawnedMobs)
const;
183 MCAPI
void _tryAddPoiToVillage(
::ActorUniqueID const& villager, ::std::weak_ptr<::POIInstance> pi);
185 MCAPI
void _tryShiftStandingsTowardNeutral(
::Tick& updateTick, uint64 updateInterval,
bool positiveShift);
187 MCAPI
void _trySpawnDefenderDwellers(
::BlockSource& region, uint64 bedCount);
189 MCAPI
void _updateAndRemoveInactiveDwellers(uint64 villagerPurgeTime,
float villageBorderTolerance);
195 MCAPI
void addActorToVillage(::DwellerRole role,
::ActorUniqueID const& actorID);
197 MCAPI
void addAggressor(
::Mob const& mob);
199 MCAPI
bool addPOI(::std::weak_ptr<::POIInstance> pi);
203 MCAPI
bool checkNeedMoreVillagers()
const;
205 MCAPI
void debugDraw();
207 MCAPI ::std::weak_ptr<::POIInstance> fetchOwnedPOI(
::ActorUniqueID const&
id, ::POIType type);
209 MCAPI uint64 getBedPOICount()
const;
211 MCAPI ::Actor* getClosestAggressor(
::Actor* from);
213 MCAPI ::std::weak_ptr<::POIInstance> getClosestPOI(::POIType type,
::BlockPos const& position);
215 MCAPI
bool hasSpecificDweller(::DwellerRole role,
::ActorUniqueID const&
id)
const;
217 MCAPI
void loadDataByKey(::std::string
const& key,
::CompoundTag const& tag);
221 MCAPI ::std::_List_iterator<
222 ::std::_List_val<::std::_List_simple_types<::std::pair<::ActorUniqueID const, ::Village::DwellerData>>>>
223 removeActorFromVillage(::DwellerRole role,
::ActorUniqueID const& actor);
225 MCAPI
void removeAllInstancesofActorFromVillage(
::ActorUniqueID const& actor);
227 MCAPI
void removeVillageSavedData();
229 MCAPI
void rewardAllPlayers(
int deltaAmount);
233 MCAPI
void tickRaid(
::Tick gameTick);
235 MCAPI
void triggerRaid();
237 MCAPI
void unlinkMismatchedJobsites(
::Actor const& villager);
247 MCAPI static ::std::shared_ptr<::POIInstance> _findPreferredPOI(
248 ::std::vector<::std::weak_ptr<::POIInstance>>& unclaimedPOIStack,
258 MCAPI static ::std::string
const& CELEBRATION_EVENT();
260 MCAPI
static bool& DEBUG_DRAWING();
262 MCAPI static ::Vec3
const& RAID_BOUNDS_PADDING();
264 MCAPI static ::std::string
const& RAID_EXPIRY_EVENT();
266 MCAPI
static int const& RAID_FINISHED_DELAY_IN_TICKS();
268 MCAPI
static int const& RAID_GROUP_COMPLETE_DELAY_IN_TICKS();
270 MCAPI
static int const& RAID_LOCATION_HELP_DELAY_IN_TICKS();
272 MCAPI
static uchar
const& RAID_MAX_SPAWN_FAILURES();
274 MCAPI
static int const& RAID_PREP_TIME_IN_TICKS();
276 MCAPI static ::Tick
const& RAID_TIMEOUT_IN_TICKS();
278 MCAPI static ::std::string
const& STORAGE_KEY_DWELLERS();
280 MCAPI static ::std::string
const& STORAGE_KEY_PLAYERS();
282 MCAPI static ::std::string
const& STORAGE_KEY_POI();
284 MCAPI static ::std::string
const& STORAGE_KEY_PREFIX();
286 MCAPI static ::std::string
const& STORAGE_KEY_RAID();
288 MCAPI static ::std::string
const& STORAGE_KEY_VILLAGE();