86 public ::std::enable_shared_from_this<::Dimension> {
99 ::ll::TypedStorage<4, 4, float> mMinFlashDuration;
100 ::ll::TypedStorage<4, 4, float> mMaxFlashDuration;
101 ::ll::TypedStorage<4, 4, float> mMinFlashCooldown;
102 ::ll::TypedStorage<4, 4, float> mMaxFlashCooldown;
110 ::ll::TypedStorage<4, 4, float> mAngle;
111 ::ll::TypedStorage<4, 4, float> mPerpendicularAngle;
112 ::ll::TypedStorage<4, 4, float> mIntensityMultiplier;
113 ::ll::TypedStorage<4, 4, ::DirectionalLightSource> mLightSource;
114 ::ll::TypedStorage<1, 1, bool> mDisableLightSource;
118 using ActorTagList = ::std::vector<::std::unique_ptr<::CompoundTag>>;
120 using ChunkPosToActorListMap = ::std::unordered_map<::ChunkPos, ::std::vector<::std::unique_ptr<::CompoundTag>>>;
122 using DirectionalLightControls = ::std::variant<::Dimension::ChaoticDirectionalLightControls>;
127 ::ll::TypedStorage<8, 24, ::std::vector<::ActorChunkTransferEntry>> mActorChunkTransferQueue;
128 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ChunkKey, ::std::vector<::ActorUnloadedChunkTransferEntry>>>
129 mActorUnloadedChunkTransferQueue;
130 ::ll::TypedStorage<8, 8, ::ILevel&> mLevel;
131 ::ll::TypedStorage<2, 4, ::DimensionHeightRange> mHeightRange;
132 ::ll::TypedStorage<2, 2, short> mSeaLevel;
133 ::ll::TypedStorage<1, 1, uchar> mMonsterSpawnBlockLightLimit;
134 ::ll::TypedStorage<8, 32, ::IntProvider> mMonsterSpawnLightTest;
135 ::ll::TypedStorage<8, 16, ::OwnerPtr<::BlockSource>> mBlockSource;
136 ::ll::TypedStorage<1, 1, bool> mHasWeather;
137 ::ll::TypedStorage<4, 28, float[7]> mMobsPerChunkSurface;
138 ::ll::TypedStorage<4, 28, float[7]> mMobsPerChunkUnderground;
139 ::ll::TypedStorage<1, 2, ::BrightnessPair> mDefaultBrightness;
140 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DimensionBrightnessRamp>> mDimensionBrightnessRamp;
141 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LevelChunkMetaData>> mTargetMetaData;
142 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RuntimeLightingManager>> mRuntimeLightingManager;
143 ::ll::TypedStorage<8, 32, ::std::string> mName;
144 ::ll::TypedStorage<8, 32, ::std::string> mTypeId;
145 ::ll::TypedStorage<4, 4, ::DimensionType> mId;
146 ::ll::TypedStorage<2, 2, ::DimensionIdType const> mRegistryId;
147 ::ll::TypedStorage<1, 1, bool> mUltraWarm;
148 ::ll::TypedStorage<1, 1, bool> mHasCeiling;
149 ::ll::TypedStorage<1, 1, bool> mHasSkylight;
150 ::ll::TypedStorage<1, 1, ::Brightness> mSkyDarken;
151 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockEventDispatcher>> mDispatcher;
152 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mTaskGroup;
153 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mChunkGenTaskGroup;
154 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PostprocessingManager>> mPostProcessingManager;
155 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SubChunkInterlocker>> mSubChunkInterlocker;
156 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ChunkSource>> mChunkSource;
157 ::ll::TypedStorage<8, 8, ::WorldGenerator*> mWorldGenerator;
158 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Weather>> mWeather;
159 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Seasons>> mSeasons;
160 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::GameEventDispatcher>> mGameEventDispatcher;
161 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CircuitSystem>> mCircuitSystem;
162 ::ll::TypedStorage<4, 4, int const> CIRCUIT_TICK_RATE;
163 ::ll::TypedStorage<4, 4, int> mCircuitSystemTickRate;
164 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::WeakEntityRef>> mActorIDEntityIDMap;
165 ::ll::TypedStorage<8, 24, ::std::vector<::WeakEntityRef>> mDisplayEntities;
166 ::ll::TypedStorage<8, 72, ::FeatureTerrainAdjustments> mFeatureTerrainAdjustments;
167 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ChunkPos, ::std::vector<::std::unique_ptr<::CompoundTag>>>>
169 ::ll::TypedStorage<8, 16, ::std::set<::ActorUniqueID>> mEntitiesToMoveChunks;
170 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::TickingAreaList>> mTickingAreaList;
171 ::ll::TypedStorage<8, 120, ::LevelChunkGarbageCollector> mLevelChunkGarbageCollector;
172 ::ll::TypedStorage<8, 16, ::std::set<::ActorUniqueID>> mWitherIDs;
173 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LevelChunkBuilderData>> mLevelChunkBuilderData;
174 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastPruneTime;
175 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastStructurePruneTime;
176 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ChunkBuildOrderPolicyBase>> mChunkBuildOrderPolicy;
177 ::ll::TypedStorage<8, 40, ::ChunkGenSessionContext> mChunkGenSessionContext;
178 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::VillageManager>> mVillageManager;
179 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Poi::Manager>> mPoiManager;
180 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkIdentifierWithSubId>> mTemporaryPlayerIds;
181 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ChunkLoadActionList>> mChunkLoadActionList;
182 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DelayActionList>> mDelayActionList;
183 ::ll::TypedStorage<8, 64, ::std::unordered_map<::SubChunkPos, ::UpdateSubChunkBlocksChangedInfo>>
184 mBlocksChangedBySubChunkMap;
185 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IClientDimensionExtensions>> mClientExtensions;
186 ::ll::TypedStorage<8, 112, ::ActorReplication> mActorReplication;
187 ::ll::TypedStorage<8, 24, ::std::vector<::WeakEntityRef>> mPlayersToReplicate;
188 ::ll::TypedStorage<1, 1, bool> mRunChunkGenWatchDog;
192 [[nodiscard]] ushort getHeightInSubchunks()
const {
194 return static_cast<ushort
>((mHeightRange->mMax - mHeightRange->mMin) / 16);
212 virtual void tickRedstone();
214 virtual ::std::unique_ptr<::WorldGenerator>
221 virtual void initializeWithLevelStorageManagerConnector(
225 virtual bool levelChunkNeedsUpgrade(
::LevelChunk const& lc)
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;
247 virtual
void setDimensionDirectionalLightControls(
248 ::
std::variant<::
Dimension::ChaoticDirectionalLightControls> const& directionalLightControls
251 virtual ::
Dimension::DirectionalLightState getDimensionDirectionalLightSourceState(
float a) const;
255 virtual
void forEachPlayer(::brstd::function_ref<
bool(::
Player&)> callback) const ;
261 virtual ::
BlockSource& getBlockSourceFromMainChunkSource() const ;
267 virtual
void deserialize(::
CompoundTag const& tag) ;
271 virtual
void sendBroadcast(::
Packet const& packet, ::
Player* except);
273 virtual
bool is2DPositionRelevantForPlayer(::
BlockPos const& position, ::
Player& player) const;
275 virtual
void buildPlayersForPositionPacket(
282 sendPacketForPosition(::
BlockPos const& position, ::
Packet const& packet, ::
Player const* except) ;
284 virtual
void sendPacketForEntity(::
Actor const& actor, ::
Packet const& packet, ::
Player const* except) ;
286 virtual
bool isActorRelevantForPlayer(::
Player& player, ::
Actor const& actor) const;
288 virtual
void onBlockEvent(::
BlockSource& source,
int x,
int y,
int z,
int b0,
int b1) ;
290 virtual
void onBlockChanged(
294 ::
Block const& block,
295 ::
Block const& oldBlock,
298 ::BlockChangedEventTarget eventTarget,
299 ::
Actor* blockChangeSource
302 virtual
void onLevelDestruction(::
std::
string const&) ;
306 virtual ::
std::vector<::
std::
string> const getStructuresFromChunkRegistry(::
Vec3 const& location) const;
308 virtual ::
std::optional<::
std::
string> const getStructureFromStructureRegistry(::
Vec3 const& location) const;
310 virtual
void startLeaveGame();
312 virtual
void flushLevelChunkGarbageCollector() ;
314 virtual
void updatePoiBlockStateChange(::
BlockPos pos, ::
Block const& removed, ::
Block const& placed) const
319 virtual
void _upgradeOldLimboEntity(::
CompoundTag& tag, ::LimboEntitiesVersion vers) = 0;
321 virtual ::
std::unique_ptr<::
ChunkSource> _wrapStorageForVersionCompatibility(
323 ::StorageVersion levelVersion
332 MCAPI
void _addActorUnloadedChunkTransferToQueue(
336 ::
std::
string& actorStorageKey,
342 MCAPI
void _tickEntityChunkMoves();
346 MCAPI ::
Player* fetchNearestInteractablePlayer(::
Vec3 const& searchPos,
float maxDist) const;
352 MCAPI
void flagEntityforChunkMove(
::Actor& e);
354 MCAPI
void flushRunTimeLighting();
356 MCAPI ::ChunkSource& getChunkSource()
const;
359 MCAPI
float getSkyDarken(
float a)
const;
361 MCAPI
float getSunAngle(
float a)
const;
363 MCAPI
float getTimeOfDay(
float a)
const;
371 transferEntity(
::ChunkPos const& fromChunkPos,
::Vec3 const& spawnPos, ::std::unique_ptr<::CompoundTag> entityTag);
373 MCAPI
void tryLoadLimboEntities(
::ChunkPos const& loadPos);
381 MCAPI static ::std::add_lvalue_reference_t<float const[]> MOON_BRIGHTNESS_PER_PHASE();
403 MCAPI
void $tickRedstone();
408 MCFOLD
bool $isNaturalDimension()
const;
410 MCFOLD
bool $isValidSpawn(
int x,
int z)
const;
412 MCAPI ::mce::Color $getBrightnessDependentFogColor(
::mce::Color const& baseColor,
float brightness)
const;
414 MCAPI
short $getCloudHeight()
const;
417 MCAPI ::BiomeIdType $getDefaultBiomeId()
const;
419 MCFOLD ::BiomeIdType $getDefaultBiomeId()
const;
422 MCFOLD
bool $mayRespawnViaBed()
const;
424 MCFOLD ::BlockPos $getSpawnPos()
const;
426 MCFOLD
int $getSpawnYPosition()
const;
428 MCFOLD
bool $showSky()
const;
430 MCAPI
float $getTimeOfDay(
int time,
float a)
const;
432 MCFOLD
void $setDimensionDirectionalLightControls(
433 ::std::variant<::Dimension::ChaoticDirectionalLightControls>
const& directionalLightControls
436 MCAPI ::Dimension::DirectionalLightState $getDimensionDirectionalLightSourceState(
float a)
const;
438 MCAPI ::DimensionType $getDimensionId()
const;
442 MCFOLD ::BiomeRegistry& $getBiomeRegistry();
444 MCFOLD ::BiomeRegistry
const& $getBiomeRegistry()
const;
446 MCFOLD ::BlockSource& $getBlockSourceFromMainChunkSource()
const;
448 MCAPI ::Actor* $fetchEntity(
::ActorUniqueID actorID,
bool getRemoved)
const;
458 MCAPI
bool $is2DPositionRelevantForPlayer(
::BlockPos const& position,
::Player& player)
const;
460 MCAPI
void $buildPlayersForPositionPacket(
463 ::std::vector<::NetworkIdentifierWithSubId>& result
470 MCAPI
bool $isActorRelevantForPlayer(
::Player& player,
::Actor const& actor)
const;
472 MCAPI
void $onBlockEvent(
::BlockSource& source,
int x,
int y,
int z,
int b0,
int b1);
474 MCAPI
void $onBlockChanged(
482 ::BlockChangedEventTarget eventTarget,
486 MCAPI
void $onLevelDestruction(::std::string
const&);
488 MCFOLD ::DimensionBrightnessRamp
const& $getBrightnessRamp()
const;
490 MCAPI ::std::vector<::std::string>
const $getStructuresFromChunkRegistry(
::Vec3 const& location)
const;
492 MCAPI ::std::optional<::std::string>
const $getStructureFromStructureRegistry(
::Vec3 const& location)
const;
494 MCAPI
void $startLeaveGame();
496 MCAPI
void $flushLevelChunkGarbageCollector();
500 MCAPI ::std::unique_ptr<::ChunkBuildOrderPolicyBase> $_createChunkBuildOrderPolicy();