40 enum class BedAvailabilityState :
int {
50 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Village>> village;
51 ::ll::TypedStorage<1, 1, bool> positionIsWithinVillageBounds;
52 ::ll::TypedStorage<4, 4, float> distanceToClosestEdgeOfVillage;
72 ::ll::TypedStorage<4, 4, ::VillageManager::BedAvailabilityState> bedAvailability;
76 using POIBlueprintMap = ::std::unordered_map<::BlockType const*, ::std::unique_ptr<::POIBlueprint>>;
78 using POIMap = ::std::unordered_map<::BlockPos, ::std::shared_ptr<::POIInstance>>;
80 using VillageMap = ::std::unordered_map<::mce::UUID, ::std::shared_ptr<::Village>>;
85 ::ll::TypedStorage<8, 8, ::Dimension&> mDimension;
86 ::ll::TypedStorage<8, 40, ::std::deque<::ActorUniqueID>> mFindPOIQueries;
87 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::POIInstance>>> mUnclusteredPOIs;
88 ::ll::TypedStorage<8, 64, ::std::unordered_map<::mce::UUID, ::std::shared_ptr<::Village>>> mVillages;
89 ::ll::TypedStorage<8, 192, ::std::array<::std::unordered_map<::BlockPos, ::std::shared_ptr<::POIInstance>>, 3>>
91 ::ll::TypedStorage<8, 64, ::std::unordered_map<::BlockType const*, ::std::unique_ptr<::POIBlueprint>>>
93 ::ll::TypedStorage<8, 8, ::Tick> mTickCount;
94 ::ll::TypedStorage<8, 32, ::WanderingTraderScheduler> mWanderingTraderScheduler;
95 ::ll::TypedStorage<1, 1, bool> mFinishedQueryScan;
96 ::ll::TypedStorage<4, 4, int> mCurrentXScan;
97 ::ll::TypedStorage<4, 4, int> mCurrentYScan;
98 ::ll::TypedStorage<4, 4, int> mCurrentZScan;
99 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnSaveSubscription;
100 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnLevelStorageManagerStartLeaveGameSubscription;
105 VillageManager& operator=(VillageManager
const&);
106 VillageManager(VillageManager
const&);
112 virtual ~VillageManager() ;
114 virtual ::std::weak_ptr<::Village>
115 fetchClosestVillage(
::BlockPos const& position,
int maxDistFromVillageBounds, uint searchRadius)
const ;
117 virtual ::std::weak_ptr<::Village> getVillageByID(
::mce::UUID const& villageID)
const ;
123 MCAPI
explicit VillageManager(
::Dimension& dimension);
127 MCAPI
void _assignPOIOnly(::std::shared_ptr<::POIInstance>&& pi);
130 _calculateDistanceFromPositionToEdgeOfVillage(
::BlockPos const& position,
::Village const& village)
const;
132 MCAPI ::std::shared_ptr<::Village> _createOrGetVillage(
::mce::UUID const&
id,
::BlockPos const& newVillagePos);
134 MCAPI
void _loadPOIBlueprints();
136 MCAPI
void _processNextUnclusteredPOIQuery();
138 MCAPI
void _removeEligibleVillages();
140 MCAPI
void _removeVillage(
::Village& village);
144 MCAPI
void _tryAssignPOIOrCreateVillage(::std::shared_ptr<::POIInstance>&& pi);
146 MCAPI
void _unclusterDerelictPOIs(::std::vector<::std::weak_ptr<::POIInstance>>& pois);
148 MCAPI ::std::weak_ptr<::Village> fetchClosestVillageMostSuitableForDweller(
150 int maxDistFromVillageBounds,
154 MCAPI ::std::weak_ptr<::Village> getClosestVillageWithRaid(
::BlockPos const& pos);
156 MCAPI ::HashedString
const& getPOINameFromBlueprint(
::Block const& block)
const;
158 MCAPI ::POIType getPOITypeFromBlueprint(
::Block const& block)
const;
160 MCAPI
bool hasPOI(
::BlockPos const& position, ::POIType type)
const;
165 MCAPI
bool isWanderingTraderManagedByScheduler(
::Actor const& actor);
167 MCAPI
void loadAllVillages();
171 MCAPI
void tick(
::Tick const& tick);
175 MCAPI ::std::shared_ptr<::POIInstance> tryCreatePOI(
::BlockPos const& position,
::Block const& block);
181 MCAPI
static bool shouldCreateNewVillageUsingPOI(
182 ::std::shared_ptr<::POIInstance>
const& poi,
183 ::std::shared_ptr<::Village>
const& nearestExistingVillage
190 MCAPI
static int const& MAX_POI_TOLERANCE_DIST();
208 MCAPI ::std::weak_ptr<::Village>
209 $fetchClosestVillage(
::BlockPos const& position,
int maxDistFromVillageBounds, uint searchRadius)
const;
211 MCAPI ::std::weak_ptr<::Village> $getVillageByID(
::mce::UUID const& villageID)
const;