85 public ::std::enable_shared_from_this<::Dimension> {
94 struct ChaoticDirectionalLightControls {
106 ChaoticDirectionalLightControls& operator=(ChaoticDirectionalLightControls
const&);
107 ChaoticDirectionalLightControls(ChaoticDirectionalLightControls
const&);
108 ChaoticDirectionalLightControls();
111 struct DirectionalLightState {
123 DirectionalLightState& operator=(DirectionalLightState
const&);
124 DirectionalLightState(DirectionalLightState
const&);
125 DirectionalLightState();
128 using ActorTagList = ::std::vector<::std::unique_ptr<::CompoundTag>>;
130 using ChunkPosToActorListMap = ::std::unordered_map<::ChunkPos, ::std::vector<::std::unique_ptr<::CompoundTag>>>;
132 using DirectionalLightControls = ::std::variant<::Dimension::ChaoticDirectionalLightControls>;
137 ::ll::TypedStorage<8, 24, ::std::vector<::ActorChunkTransferEntry>> mActorChunkTransferQueue;
138 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ChunkKey, ::std::vector<::ActorUnloadedChunkTransferEntry>>>
139 mActorUnloadedChunkTransferQueue;
140 ::ll::TypedStorage<8, 8, ::ILevel&> mLevel;
141 ::ll::TypedStorage<2, 4, ::DimensionHeightRange> mHeightRange;
142 ::ll::TypedStorage<2, 2, short> mSeaLevel;
143 ::ll::TypedStorage<1, 1, uchar> mMonsterSpawnBlockLightLimit;
144 ::ll::TypedStorage<4, 32, ::IntProvider> mMonsterSpawnLightTest;
145 ::ll::TypedStorage<8, 16, ::OwnerPtr<::BlockSource>> mBlockSource;
146 ::ll::TypedStorage<1, 1, bool> mHasWeather;
147 ::ll::TypedStorage<4, 28, float[7]> mMobsPerChunkSurface;
148 ::ll::TypedStorage<4, 28, float[7]> mMobsPerChunkUnderground;
149 ::ll::TypedStorage<1, 2, ::BrightnessPair> mDefaultBrightness;
150 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DimensionBrightnessRamp>> mDimensionBrightnessRamp;
151 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LevelChunkMetaData>> mTargetMetaData;
152 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RuntimeLightingManager>> mRuntimeLightingManager;
153 ::ll::TypedStorage<8, 32, ::std::string> mName;
154 ::ll::TypedStorage<4, 4, ::DimensionType> mId;
155 ::ll::TypedStorage<1, 1, bool> mUltraWarm;
156 ::ll::TypedStorage<1, 1, bool> mHasCeiling;
157 ::ll::TypedStorage<1, 1, bool> mHasSkylight;
158 ::ll::TypedStorage<1, 1, ::Brightness> mSkyDarken;
159 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockEventDispatcher>> mDispatcher;
160 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mTaskGroup;
161 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mChunkGenTaskGroup;
162 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PostprocessingManager>> mPostProcessingManager;
163 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SubChunkInterlocker>> mSubChunkInterlocker;
164 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ChunkSource>> mChunkSource;
165 ::ll::TypedStorage<8, 8, ::WorldGenerator*> mWorldGenerator;
166 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Weather>> mWeather;
167 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Seasons>> mSeasons;
168 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::GameEventDispatcher>> mGameEventDispatcher;
169 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CircuitSystem>> mCircuitSystem;
170 ::ll::TypedStorage<4, 4, int const> CIRCUIT_TICK_RATE;
171 ::ll::TypedStorage<4, 4, int> mCircuitSystemTickRate;
172 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::WeakEntityRef>> mActorIDEntityIDMap;
173 ::ll::TypedStorage<8, 24, ::std::vector<::WeakEntityRef>> mDisplayEntities;
174 ::ll::TypedStorage<8, 72, ::FeatureTerrainAdjustments> mFeatureTerrainAdjustments;
175 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ChunkPos, ::std::vector<::std::unique_ptr<::CompoundTag>>>>
177 ::ll::TypedStorage<8, 16, ::std::set<::ActorUniqueID>> mEntitiesToMoveChunks;
178 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::TickingAreaList>> mTickingAreaList;
179 ::ll::TypedStorage<8, 632, ::LevelChunkGarbageCollector> mLevelChunkGarbageCollector;
180 ::ll::TypedStorage<8, 16, ::std::set<::ActorUniqueID>> mWitherIDs;
181 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LevelChunkBuilderData>> mLevelChunkBuilderData;
182 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastPruneTime;
183 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastStructurePruneTime;
184 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ChunkBuildOrderPolicyBase>> mChunkBuildOrderPolicy;
185 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::VillageManager>> mVillageManager;
186 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Poi::Manager>> mPoiManager;
187 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkIdentifierWithSubId>> mTemporaryPlayerIds;
188 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ChunkLoadActionList>> mChunkLoadActionList;
189 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DelayActionList>> mDelayActionList;
190 ::ll::TypedStorage<8, 64, ::std::unordered_map<::SubChunkPos, ::UpdateSubChunkBlocksChangedInfo>>
191 mBlocksChangedBySubChunkMap;
192 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IClientDimensionExtensions>> mClientExtensions;
193 ::ll::TypedStorage<8, 112, ::ActorReplication> mActorReplication;
194 ::ll::TypedStorage<8, 24, ::std::vector<::WeakEntityRef>> mPlayersToReplicate;
195 ::ll::TypedStorage<1, 1, bool> mRunChunkGenWatchDog;
200 Dimension& operator=(Dimension
const&);
201 Dimension(Dimension
const&);
207 virtual ~Dimension() ;
213 virtual void tickRedstone();
221 virtual void initializeWithLevelStorageManagerConnector(
225 virtual bool levelChunkNeedsUpgrade(
::LevelChunk const&)
const = 0;
227 virtual bool isNaturalDimension() const ;
229 virtual
bool isValidSpawn(
int x,
int z) const;
231 virtual ::mce::Color getBrightnessDependentFogColor(::mce::Color const& baseColor,
float brightness) const;
233 virtual
short getCloudHeight() const;
237 virtual
bool mayRespawnViaBed() const;
239 virtual ::
BlockPos getSpawnPos() const;
241 virtual
int getSpawnYPosition() const;
243 virtual
bool showSky() const;
245 virtual
float getTimeOfDay(
int time,
float a) const;
252 virtual ::DimensionType getDimensionId() const ;
254 virtual
void forEachPlayer(::brstd::function_ref<
bool(::
Player&)> callback) const ;
260 virtual ::
BlockSource& getBlockSourceFromMainChunkSource() const ;
266 virtual
void deserialize(::
CompoundTag const& tag) ;
270 virtual
void sendBroadcast(::
Packet const& packet, ::
Player* except);
272 virtual
bool is2DPositionRelevantForPlayer(::
BlockPos const& position, ::
Player& player) const;
274 virtual
void buildPlayersForPositionPacket(
281 sendPacketForPosition(::
BlockPos const& position, ::
Packet const& packet, ::
Player const* except) ;
283 virtual
void sendPacketForEntity(::
Actor const& actor, ::
Packet const& packet, ::
Player const* except) ;
285 virtual
bool isActorRelevantForPlayer(::
Player& player, ::
Actor const& actor) const;
287 virtual
void onBlockEvent(::
BlockSource& source,
int x,
int y,
int z,
int b0,
int b1) ;
289 virtual
void onBlockChanged(
293 ::
Block const& block,
294 ::
Block const& oldBlock,
297 ::BlockChangedEventTarget eventTarget,
298 ::
Actor* blockChangeSource
301 virtual
void onLevelDestruction(::
std::
string const&) ;
305 virtual ::
std::vector<::
std::
string> const getStructuresFromChunkRegistry(::
Vec3 const& location) const;
307 virtual ::
std::optional<::
std::
string> const getStructureFromStructureRegistry(::
Vec3 const& location) const;
309 virtual
void startLeaveGame();
311 virtual
void flushLevelChunkGarbageCollector() ;
313 virtual
void updatePoiBlockStateChange(::
BlockPos pos, ::
Block const& removed, ::
Block const& placed) const
318 virtual
void _upgradeOldLimboEntity(::
CompoundTag&, ::LimboEntitiesVersion) = 0;
321 _wrapStorageForVersionCompatibility(::
std::unique_ptr<::
ChunkSource>, ::StorageVersion) = 0;
329 MCAPI
void _addActorUnloadedChunkTransferToQueue(
332 ::DimensionType dimId,
333 ::
std::
string& actorStorageKey,
339 MCAPI ::Bedrock::NonOwnerPointer<::
ChunkSource> _getOrCreateClientServerMainChunkSource() const;
341 MCAPI
void _processEntityChunkTransfers();
343 MCAPI
void _runChunkGenerationWatchdog();
345 MCAPI
void _sendBlocksChangedPackets();
349 MCAPI
void _tickEntityChunkMoves();
353 MCAPI ::
Player* fetchAnyInteractablePlayer(::
Vec3 const& searchPos,
float maxDist) const;
355 MCAPI ::
Player* fetchNearestAttackablePlayer(::
Actor& source,
float maxDist) const;
357 MCAPI ::
Player* fetchNearestInteractablePlayer(::
Vec3 const& searchPos,
float maxDist) const;
359 MCAPI ::
Player* fetchNearestPlayer(
360 ::
Vec3 const& searchPos,
363 ::brstd::function_ref<
bool(::
Player const&)> playerFilter
366 MCAPI ::
Player* findPlayer(::brstd::function_ref<
bool(::
Player const&)> pred) const;
368 MCAPI
void flagEntityforChunkMove(::
Actor& e);
372 MCAPI ushort getHeightInSubchunks() const;
374 MCAPI
float getMoonBrightness() const;
376 MCAPI_C
int getMoonPhase() const;
380 MCAPI_C
float getSkyDarken(
float a) const;
382 MCAPI_C
float getSunAngle(
float a) const;
384 MCAPI_C
float getTimeOfDay(
float a) const;
386 MCAPI
bool isBrightOutside() const;
390 MCAPI
bool operator==(::Dimension const& rhs) const;
399 MCAPI
void transferEntityToUnloadedChunk(::
Actor& actor, ::
LevelChunk* fromChunk);
401 MCAPI
void transferEntityToUnloadedChunk(
404 ::DimensionType dimId,
405 ::
std::
string& actorStorageKey,
409 MCAPI
void tryGarbageCollectStructures();
411 MCAPI
void tryLoadLimboEntities(::
ChunkPos const& loadPos);
419 MCAPI static ::
std::add_lvalue_reference_t<
float const[]> MOON_BRIGHTNESS_PER_PHASE();
421 MCAPI static ::
std::chrono::seconds const& STRUCTURE_PRUNE_INTERVAL();
439 MCAPI
void $init(::br::worldgen::StructureSetRegistry const& structureSetRegistry);
443 MCAPI
void $tickRedstone();
448 MCFOLD
bool $isNaturalDimension() const;
450 MCFOLD
bool $isValidSpawn(
int x,
int z) const;
452 MCAPI ::mce::Color $getBrightnessDependentFogColor(::mce::Color const& baseColor,
float brightness) const;
454 MCFOLD
short $getCloudHeight() const;
458 MCFOLD
bool $mayRespawnViaBed() const;
460 MCFOLD ::
BlockPos $getSpawnPos() const;
462 MCFOLD
int $getSpawnYPosition() const;
464 MCFOLD
bool $showSky() const;
466 MCAPI
float $getTimeOfDay(
int time,
float a) const;
473 MCAPI ::DimensionType $getDimensionId() const;
475 MCAPI
void $forEachPlayer(::brstd::function_ref<
bool(::
Player&)> callback) const;
481 MCFOLD ::
BlockSource& $getBlockSourceFromMainChunkSource() const;
491 MCAPI
void $sendBroadcast(::
Packet const& packet, ::
Player* except);
493 MCAPI
bool $is2DPositionRelevantForPlayer(::
BlockPos const& position, ::
Player& player) const;
495 MCAPI
void $buildPlayersForPositionPacket(
501 MCAPI
void $sendPacketForPosition(::
BlockPos const& position, ::
Packet const& packet, ::
Player const* except);
503 MCAPI
void $sendPacketForEntity(::
Actor const& actor, ::
Packet const& packet, ::
Player const* except);
505 MCAPI
bool $isActorRelevantForPlayer(::
Player& player, ::
Actor const& actor) const;
507 MCAPI
void $onBlockEvent(::
BlockSource& source,
int x,
int y,
int z,
int b0,
int b1);
509 MCAPI
void $onBlockChanged(
513 ::
Block const& block,
514 ::
Block const& oldBlock,
517 ::BlockChangedEventTarget eventTarget,
518 ::
Actor* blockChangeSource
521 MCAPI
void $onLevelDestruction(::
std::
string const&);
525 MCAPI ::
std::vector<::
std::
string> const $getStructuresFromChunkRegistry(::
Vec3 const& location) const;
527 MCAPI ::
std::optional<::
std::
string> const $getStructureFromStructureRegistry(::
Vec3 const& location) const;
529 MCAPI
void $startLeaveGame();
531 MCAPI
void $flushLevelChunkGarbageCollector();
533 MCAPI
void $updatePoiBlockStateChange(::
BlockPos pos, ::
Block const& removed, ::
Block const& placed) const;