89 public ::std::enable_shared_from_this<::Dimension> {
102 ::ll::TypedStorage<4, 4, float> mMinFlashDuration;
103 ::ll::TypedStorage<4, 4, float> mMaxFlashDuration;
104 ::ll::TypedStorage<4, 4, float> mMinFlashCooldown;
105 ::ll::TypedStorage<4, 4, float> mMaxFlashCooldown;
113 ::ll::TypedStorage<4, 4, float> mAngle;
114 ::ll::TypedStorage<4, 4, float> mPerpendicularAngle;
115 ::ll::TypedStorage<4, 4, float> mIntensityMultiplier;
116 ::ll::TypedStorage<4, 4, ::DirectionalLightSource> mLightSource;
120 using ActorTagList = ::std::vector<::std::unique_ptr<::CompoundTag>>;
122 using ChunkPosToActorListMap = ::std::unordered_map<::ChunkPos, ::std::vector<::std::unique_ptr<::CompoundTag>>>;
124 using DirectionalLightControls = ::std::variant<::Dimension::ChaoticDirectionalLightControls>;
129 ::ll::TypedStorage<8, 24, ::std::vector<::ActorChunkTransferEntry>> mActorChunkTransferQueue;
130 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ChunkKey, ::std::vector<::ActorUnloadedChunkTransferEntry>>>
131 mActorUnloadedChunkTransferQueue;
132 ::ll::TypedStorage<8, 8, ::ILevel&> mLevel;
133 ::ll::TypedStorage<2, 4, ::DimensionHeightRange> mHeightRange;
134 ::ll::TypedStorage<2, 2, short> mSeaLevel;
135 ::ll::TypedStorage<1, 1, uchar> mMonsterSpawnBlockLightLimit;
136 ::ll::TypedStorage<8, 32, ::IntProvider> mMonsterSpawnLightTest;
137 ::ll::TypedStorage<8, 16, ::OwnerPtr<::BlockSource>> mBlockSource;
138 ::ll::TypedStorage<1, 1, bool> mHasWeather;
139 ::ll::TypedStorage<4, 28, float[7]> mMobsPerChunkSurface;
140 ::ll::TypedStorage<4, 28, float[7]> mMobsPerChunkUnderground;
141 ::ll::TypedStorage<1, 2, ::BrightnessPair> mDefaultBrightness;
142 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DimensionBrightnessRamp>> mDimensionBrightnessRamp;
143 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LevelChunkMetaData>> mTargetMetaData;
144 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RuntimeLightingManager>> mRuntimeLightingManager;
145 ::ll::TypedStorage<8, 32, ::std::string> mName;
146 ::ll::TypedStorage<8, 32, ::std::string> mTypeId;
147 ::ll::TypedStorage<4, 4, ::DimensionType> mId;
148 ::ll::TypedStorage<2, 2, ::DimensionIdType const> mRegistryId;
149 ::ll::TypedStorage<1, 1, bool> mUltraWarm;
150 ::ll::TypedStorage<1, 1, bool> mHasCeiling;
151 ::ll::TypedStorage<1, 1, bool> mHasSkylight;
152 ::ll::TypedStorage<1, 1, ::Brightness> mSkyDarken;
153 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockEventDispatcher>> mDispatcher;
154 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mTaskGroup;
155 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mChunkGenTaskGroup;
156 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PostprocessingManager>> mPostProcessingManager;
157 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SubChunkInterlocker>> mSubChunkInterlocker;
158 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ChunkSource>> mChunkSource;
159 ::ll::TypedStorage<8, 8, ::WorldGenerator*> mWorldGenerator;
160 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Weather>> mWeather;
161 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Seasons>> mSeasons;
162 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::GameEventDispatcher>> mGameEventDispatcher;
163 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CircuitSystem>> mCircuitSystem;
164 ::ll::TypedStorage<4, 4, int const> CIRCUIT_TICK_RATE;
165 ::ll::TypedStorage<4, 4, int> mCircuitSystemTickRate;
166 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::WeakEntityRef>> mActorIDEntityIDMap;
167 ::ll::TypedStorage<8, 24, ::std::vector<::WeakEntityRef>> mDisplayEntities;
168 ::ll::TypedStorage<8, 72, ::FeatureTerrainAdjustments> mFeatureTerrainAdjustments;
169 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ChunkPos, ::std::vector<::std::unique_ptr<::CompoundTag>>>>
171 ::ll::TypedStorage<8, 16, ::std::set<::ActorUniqueID>> mEntitiesToMoveChunks;
172 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::TickingAreaList>> mTickingAreaList;
173 ::ll::TypedStorage<8, 632, ::LevelChunkGarbageCollector> mLevelChunkGarbageCollector;
174 ::ll::TypedStorage<8, 16, ::std::set<::ActorUniqueID>> mWitherIDs;
175 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LevelChunkBuilderData>> mLevelChunkBuilderData;
176 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastPruneTime;
177 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastStructurePruneTime;
178 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ChunkBuildOrderPolicyBase>> mChunkBuildOrderPolicy;
179 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::VillageManager>> mVillageManager;
180 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Poi::Manager>> mPoiManager;
181 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkIdentifierWithSubId>> mTemporaryPlayerIds;
182 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ChunkLoadActionList>> mChunkLoadActionList;
183 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DelayActionList>> mDelayActionList;
184 ::ll::TypedStorage<8, 64, ::std::unordered_map<::SubChunkPos, ::UpdateSubChunkBlocksChangedInfo>>
185 mBlocksChangedBySubChunkMap;
186 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IClientDimensionExtensions>> mClientExtensions;
187 ::ll::TypedStorage<8, 112, ::ActorReplication> mActorReplication;
188 ::ll::TypedStorage<8, 24, ::std::vector<::WeakEntityRef>> mPlayersToReplicate;
189 ::ll::TypedStorage<1, 1, bool> mRunChunkGenWatchDog;
194 Dimension& operator=(Dimension
const&);
195 Dimension(Dimension
const&);
201 virtual ~Dimension() ;
207 virtual void tickRedstone();
209 virtual ::std::unique_ptr<::WorldGenerator>
216 virtual void initializeWithLevelStorageManagerConnector(
220 virtual bool levelChunkNeedsUpgrade(
::LevelChunk const& lc)
const = 0;
222 virtual bool isNaturalDimension() const ;
224 virtual
bool isValidSpawn(
int,
int) const;
226 virtual ::mce::Color getBrightnessDependentFogColor(::mce::Color const& baseColor,
float brightness) const;
228 virtual
short getCloudHeight() const;
232 virtual
bool mayRespawnViaBed() const;
234 virtual ::
BlockPos getSpawnPos() const;
236 virtual
int getSpawnYPosition() const;
238 virtual
bool showSky() const;
240 virtual
float getTimeOfDay(
int time,
float a) const;
242 virtual
void setDimensionDirectionalLightControls(
250 virtual
void forEachPlayer(::brstd::function_ref<
bool(::
Player&)> callback) const ;
256 virtual ::
BlockSource& getBlockSourceFromMainChunkSource() const ;
262 virtual
void deserialize(::
CompoundTag const& tag) ;
266 virtual
void sendBroadcast(::
Packet const& packet, ::
Player* except);
268 virtual
bool is2DPositionRelevantForPlayer(::
BlockPos const& position, ::
Player& player) const;
270 virtual
void buildPlayersForPositionPacket(
277 sendPacketForPosition(::
BlockPos const& position, ::
Packet const& packet, ::
Player const* except) ;
279 virtual
void sendPacketForEntity(::
Actor const& actor, ::
Packet const& packet, ::
Player const* except) ;
281 virtual
bool isActorRelevantForPlayer(::
Player& player, ::
Actor const& actor) const;
283 virtual
void onBlockEvent(::
BlockSource& source,
int x,
int y,
int z,
int b0,
int b1) ;
285 virtual
void onBlockChanged(
289 ::
Block const& block,
290 ::
Block const& oldBlock,
293 ::BlockChangedEventTarget eventTarget,
294 ::
Actor* blockChangeSource
297 virtual
void onLevelDestruction(::
std::
string const&) ;
301 virtual ::
std::vector<::
std::
string> const getStructuresFromChunkRegistry(::
Vec3 const& location) const;
303 virtual ::
std::optional<::
std::
string> const getStructureFromStructureRegistry(::
Vec3 const& location) const;
305 virtual
void startLeaveGame();
307 virtual
void flushLevelChunkGarbageCollector() ;
309 virtual
void updatePoiBlockStateChange(::
BlockPos, ::
Block const&, ::
Block const&) const ;
313 virtual
void _upgradeOldLimboEntity(::
CompoundTag& tag, ::LimboEntitiesVersion vers) = 0;
315 virtual ::
std::unique_ptr<::
ChunkSource> _wrapStorageForVersionCompatibility(
317 ::StorageVersion levelVersion
326 MCAPI
void _addActorUnloadedChunkTransferToQueue(
330 ::
std::
string& actorStorageKey,
338 MCAPI
void _processEntityChunkTransfers();
340 MCAPI
void _runChunkGenerationWatchdog();
342 MCAPI
void _sendBlockEntityUpdatePacket(::
BlockPos const& pos);
344 MCAPI
void _sendBlocksChangedPackets();
348 MCAPI
void _tickEntityChunkMoves();
350 MCAPI
void addPlayerToReplication(::
WeakEntityRef const& player);
354 MCAPI
void clearPlayerReplicationList();
356 MCAPI
float distanceToNearestPlayerSqr2D(::
Vec3 origin);
358 MCAPI ::
Player* fetchAnyInteractablePlayer(::
Vec3 const& searchPos,
float maxDist) const;
360 MCAPI ::
Player* fetchNearestAttackablePlayer(::
Actor& source,
float maxDist) const;
362 MCAPI ::
Player* fetchNearestAttackablePlayer(::
BlockPos source,
float maxDist, ::
Actor* sourceActor) const;
364 MCAPI ::
Player* fetchNearestInteractablePlayer(::
Vec3 const& searchPos,
float maxDist) const;
366 MCAPI ::
Player* fetchNearestInteractablePlayer(::
Actor& source,
float maxDist) const;
368 MCAPI ::
Player* fetchNearestPlayer(
369 ::
Vec3 const& searchPos,
372 ::brstd::function_ref<
bool(::
Player const&)> playerFilter
375 MCAPI ::
Player* findPlayer(::brstd::function_ref<
bool(::
Player const&)> pred) const;
377 MCAPI
void flagEntityforChunkMove(::
Actor& e);
379 MCAPI
void flushRunTimeLighting();
398 MCFOLD ::std::unordered_map<::ActorUniqueID, ::WeakEntityRef>
const& getEntityIdMapConst()
const;
401 MCFOLD ::FeatureTerrainAdjustments& getFeatureTerrainAdjustments();
403 MCAPI ::GameEventDispatcher* getGameEventDispatcher()
const;
405 MCAPI
short getHeight()
const;
407 MCAPI ushort getHeightInSubchunks()
const;
409 MCFOLD ::DimensionHeightRange
const& getHeightRange()
const;
411 MCFOLD ::Level& getLevel()
const;
413 MCFOLD ::Level
const& getLevelConst()
const;
415 MCAPI ::std::string getLocalizationKey()
const;
417 MCAPI
short getMinHeight()
const;
419 MCAPI uchar getMonsterSpawnBlockLightLimit()
const;
421 MCAPI ::IntProvider getMonsterSpawnLightTest()
const;
423 MCAPI
float getMoonBrightness()
const;
425 MCAPI
int getMoonPhase()
const;
427 MCAPI ::Brightness getOldSkyDarken(
float a);
429 MCAPI
float getPopCap(
int catID,
bool surface)
const;
431 MCFOLD ::Seasons& getSeasons();
434 MCAPI
float getSkyDarken(
float a)
const;
437 MCAPI ::Brightness getSkyDarken()
const;
439 MCAPI
float getSunAngle(
float a)
const;
441 MCFOLD ::std::shared_ptr<::LevelChunkMetaData const> getTargetMetaData();
443 MCFOLD ::TickingAreaList& getTickingAreas();
445 MCFOLD ::TickingAreaList
const& getTickingAreasConst()
const;
447 MCAPI
float getTimeOfDay(
float a)
const;
449 MCFOLD ::std::string
const& getTypeId()
const;
451 MCAPI ::std::unique_ptr<::VillageManager>
const& getVillageManager()
const;
453 MCAPI ::WeakRef<::Dimension> getWeakRef();
455 MCFOLD ::Weather& getWeather()
const;
457 MCFOLD ::WorldGenerator* getWorldGenerator()
const;
460 MCAPI
bool hasAddedWither()
const;
463 MCAPI
bool hasCeiling()
const;
465 MCFOLD
bool hasSkylight()
const;
467 MCAPI
bool isBrightOutside()
const;
469 MCAPI
bool isChunkKnown(
::ChunkPos const& chunkPos)
const;
471 MCAPI
bool const isClientSideGenerationEnabled()
const;
473 MCAPI
bool isHeightWithinRange(
short const& height)
const;
475 MCAPI
bool isLeaveGameDone();
477 MCAPI
bool isMoonVisible()
const;
479 MCAPI
bool isRedstoneTick();
481 MCAPI
bool isSubChunkHeightWithinRange(
short const& subChunkHeight)
const;
483 MCAPI
bool isUltraWarm()
const;
487 MCAPI
void onStaticTickingAreaAdded(::std::string
const& tickingAreaName);
489 MCAPI
void pauseAndFlushTaskGroups();
491 MCAPI
void processPlayerReplication();
503 MCAPI
void sendPacketToClients(
::Packet const& packet, ::std::vector<::NetworkIdentifierWithSubId> ids);
505 MCAPI
void setCeiling(
bool ceiling);
508 MCAPI
void setRunChunkGenWatchDog(
bool runWatchDog);
511 MCAPI
void setSkylight(
bool skylight);
513 MCAPI
void setUltraWarm(
bool warm);
520 transferEntity(
::ChunkPos const& fromChunkPos,
::Vec3 const& spawnPos, ::std::unique_ptr<::CompoundTag> entityTag);
524 MCAPI
void tryGarbageCollectStructures();
526 MCAPI
void tryLoadLimboEntities(
::ChunkPos const& loadPos);
532 MCAPI
void updateBlockLight(
551 MCAPI static ::std::add_lvalue_reference_t<float const[]> MOON_BRIGHTNESS_PER_PHASE();
573 MCAPI
void $tickRedstone();
578 MCFOLD
bool $isNaturalDimension()
const;
580 MCFOLD
bool $isValidSpawn(
int,
int)
const;
582 MCAPI ::mce::Color $getBrightnessDependentFogColor(
::mce::Color const& baseColor,
float brightness)
const;
584 MCAPI
short $getCloudHeight()
const;
586 MCAPI ::BiomeIdType $getDefaultBiomeId()
const;
588 MCFOLD
bool $mayRespawnViaBed()
const;
590 MCFOLD ::BlockPos $getSpawnPos()
const;
592 MCFOLD
int $getSpawnYPosition()
const;
594 MCFOLD
bool $showSky()
const;
596 MCAPI
float $getTimeOfDay(
int time,
float a)
const;
598 MCFOLD
void $setDimensionDirectionalLightControls(
599 ::std::variant<::Dimension::ChaoticDirectionalLightControls>
const& directionalLightControls
602 MCAPI ::Dimension::DirectionalLightState $getDimensionDirectionalLightSourceState(
float a)
const;
604 MCAPI ::DimensionType $getDimensionId()
const;
608 MCFOLD ::BiomeRegistry& $getBiomeRegistry();
610 MCFOLD ::BiomeRegistry
const& $getBiomeRegistry()
const;
612 MCFOLD ::BlockSource& $getBlockSourceFromMainChunkSource()
const;
614 MCAPI ::Actor* $fetchEntity(
::ActorUniqueID actorID,
bool getRemoved)
const;
624 MCAPI
bool $is2DPositionRelevantForPlayer(
::BlockPos const& position,
::Player& player)
const;
626 MCAPI
void $buildPlayersForPositionPacket(
629 ::std::vector<::NetworkIdentifierWithSubId>& result
636 MCAPI
bool $isActorRelevantForPlayer(
::Player& player,
::Actor const& actor)
const;
638 MCAPI
void $onBlockEvent(
::BlockSource& source,
int x,
int y,
int z,
int b0,
int b1);
640 MCAPI
void $onBlockChanged(
648 ::BlockChangedEventTarget eventTarget,
652 MCAPI
void $onLevelDestruction(::std::string
const&);
654 MCFOLD ::DimensionBrightnessRamp
const& $getBrightnessRamp()
const;
656 MCAPI ::std::vector<::std::string>
const $getStructuresFromChunkRegistry(
::Vec3 const& location)
const;
658 MCAPI ::std::optional<::std::string>
const $getStructureFromStructureRegistry(
::Vec3 const& location)
const;
660 MCAPI
void $startLeaveGame();
662 MCAPI
void $flushLevelChunkGarbageCollector();
666 MCAPI ::std::unique_ptr<::ChunkBuildOrderPolicyBase> $_createChunkBuildOrderPolicy();