LeviLamina
Loading...
Searching...
No Matches
LevelChunk.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/renderer/block/tessellation_pipeline/VolumeOf.h"
7#include "mc/common/BiomeIdType.h"
8#include "mc/common/BrightnessPair.h"
9#include "mc/deps/core/container/small_vector.h"
10#include "mc/deps/core/container/small_vector_base.h"
11#include "mc/deps/core/utility/buffer_span.h"
12#include "mc/deps/game_refs/WeakRef.h"
13#include "mc/network/packet/SubChunkPacket.h"
14#include "mc/platform/threading/Mutex.h"
15#include "mc/platform/threading/SpinLockImpl.h"
16#include "mc/platform/threading/UniqueLock.h"
17#include "mc/world/actor/ActorType.h"
18#include "mc/world/level/BlockPos.h"
19#include "mc/world/level/ChunkLocalHeight.h"
20#include "mc/world/level/ChunkPos.h"
21#include "mc/world/level/Tick.h"
22#include "mc/world/level/chunk/BiomeChunkData.h"
23#include "mc/world/level/chunk/ChunkCachedDataState.h"
24#include "mc/world/level/chunk/ChunkDebugDisplaySavedState.h"
25#include "mc/world/level/chunk/ChunkState.h"
26#include "mc/world/level/chunk/ChunkTerrainDataState.h"
27#include "mc/world/level/chunk/ColumnCachedData.h"
28#include "mc/world/level/chunk/DirtyTicksCounter.h"
29#include "mc/world/level/chunk/LevelChunkBlockActorStorage.h"
30#include "mc/world/level/chunk/LevelChunkFormat.h"
31#include "mc/world/level/chunk/LevelChunkNeighbor.h"
32#include "mc/world/level/chunk/LevelChunkVolumeData.h"
33#include "mc/world/level/chunk/SubChunkInitMode.h"
34#include "mc/world/level/chunk/SubChunkStorage.h"
35#include "mc/world/level/chunk/level_chunk_ticking/Entity.h"
36#include "mc/world/level/levelgen/structure/BoundingBox.h"
37#include "mc/world/level/levelgen/v1/HardcodedSpawnAreaType.h"
38
39// auto generated forward declare list
40// clang-format off
41class AABB;
42class Actor;
43class Biome;
44class BiomeRegistry;
45class Block;
46class BlockActor;
47class BlockSource;
49class BlockVolume;
50class ChunkBlockPos;
51class ChunkSource;
52class ChunkViewSource;
53class Dimension;
54class EntityContext;
56class IDataInput;
57class IDataOutput;
58class ILevel;
60class Random;
61class SaveContext;
62class StringByteInput;
63class SubChunkPos;
64class Vec3;
65class WeakEntityRef;
66class Weather;
68struct ActorLink;
69struct BiomeChunkState;
70struct BlockID;
72struct NibblePair;
73struct SubChunk;
74namespace LevelChunkTicking { struct Registry; }
75// clang-format on
76
78public:
79 // LevelChunk inner types declare
80 // clang-format off
81 class Neighbors;
82 struct SpawningArea;
83 struct Telemetry;
84 // clang-format on
85
86 // LevelChunk inner types define
88
89 enum class Finalization : int {
90 NeedsInstaticking = 0,
91 NeedsPopulation = 1,
92 Done = 2,
93 };
94
95 class Neighbors {
96 public:
97 // member variables
98 // NOLINTBEGIN
99 ::ll::TypedStorage<1, 1, uchar> mNeighbors;
100 // NOLINTEND
101
102 public:
103 // static variables
104 // NOLINTBEGIN
105 MCNAPI static ::std::array<::std::pair<::LevelChunkNeighbor, ::ChunkPos>, 8> const& sOffsetMap();
106 // NOLINTEND
107 };
108
109 struct Telemetry {
110 public:
111 // member variables
112 // NOLINTBEGIN
113 ::ll::TypedStorage<1, 1, bool> mWasStored;
114 ::ll::TypedStorage<1, 1, bool> mWasGenerated;
115 ::ll::TypedStorage<1, 1, bool> mWasRequestedInsideTickRange;
116 ::ll::TypedStorage<1, 1, bool> mWasLoadedInsideTickRange;
117 // NOLINTEND
118 };
119
120 using BlockList = ::std::vector<::BlockPos>;
121
122 using BlockActorVector = ::std::vector<::std::shared_ptr<::BlockActor>>;
123
125 public:
126 // member variables
127 // NOLINTBEGIN
128 ::ll::TypedStorage<4, 24, ::BoundingBox> aabb;
129 ::ll::TypedStorage<1, 1, ::HardcodedSpawnAreaType> type;
130 // NOLINTEND
131 };
132
133 using BBorder = bool;
134
135 enum class DeserializeEntityResult : int {
136 FailedToLoadActor = 0,
137 FailedToAddToLevel = 1,
138 Succeeded = 2,
139 };
140
141public:
142 // member variables
143 // NOLINTBEGIN
144 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mBlockEntityAccessLock;
145 ::ll::TypedStorage<8, 8, ::ILevel&> mLevel;
146 ::ll::TypedStorage<8, 8, ::Dimension&> mDimension;
147 ::ll::TypedStorage<4, 12, ::BlockPos> mMin;
148 ::ll::TypedStorage<4, 12, ::BlockPos> mMax;
149 ::ll::TypedStorage<8, 8, ::ChunkPos> mPosition;
150 ::ll::TypedStorage<1, 1, bool> mLightingFixupDone;
151 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mLightingTaskActive;
152 ::ll::TypedStorage<1, 1, bool> mReadOnly;
153 ::ll::TypedStorage<8, 8, ::ChunkSource*> mGenerator;
154 ::ll::TypedStorage<4, 4, ::LevelChunkTicking::Entity> mTmpTickingEntity;
155 ::ll::TypedStorage<1, 2, ::std::optional<::LevelChunkFormat>> mLoadedFormat;
156 ::ll::TypedStorage<8, 32, ::std::string> mSerializedEntitiesBuffer;
157 ::ll::TypedStorage<8, 32, ::std::string> mFailedSerializedEntitiesBuffer;
158 ::ll::TypedStorage<1, 1, bool> mHadSerializedEntities;
159 ::ll::TypedStorage<8, 24, ::std::vector<::ActorLink>> mUnresolvedActorLinks;
160 ::ll::TypedStorage<1, 1, ::std::atomic<::ChunkState>> mLoadState;
161 ::ll::TypedStorage<1, 1, ::ChunkTerrainDataState> mTerrainDataState;
162 ::ll::TypedStorage<1, 1, ::ChunkDebugDisplaySavedState> mDebugDisplaySavedState;
163 ::ll::TypedStorage<1, 1, ::ChunkCachedDataState> mCachedDataState;
164 ::ll::TypedStorage<8, 32, ::SpinLockImpl> mCachedDataStateSpinLock;
165 ::ll::TypedStorage<8, 32, ::SpinLockImpl> mClientRequestHeightmapAdjustSpinLock;
166 ::ll::TypedStorage<8, 8, ::Tick> mLastTick;
167 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockTickingQueue>> mTickQueue;
168 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockTickingQueue>> mRandomTickQueue;
169 ::ll::TypedStorage<8, 24, ::std::vector<::SubChunk>> mSubChunks;
170 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::SpinLockImpl>>> mSubChunkSpinLocks;
171 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::SubChunkStorage<::Biome>>>> mBiomes;
172 ::ll::TypedStorage<2, 512, ::std::array<::BiomeChunkData, 256>> m2DBiomes;
173 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mBiomesMutex;
174 ::ll::TypedStorage<4, 2048, ::std::array<::ColumnCachedData, 256>> mCachedData;
175 ::ll::TypedStorage<2, 512, ::std::array<::ChunkLocalHeight, 256>> mHeightmap;
176 ::ll::TypedStorage<2, 512, ::std::array<::ChunkLocalHeight, 256>> mRenderHeightmap;
177 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::std::vector<short>>> mPreWorldGenHeightmap;
178 ::ll::TypedStorage<2, 2, ::ChunkLocalHeight> mNonAirMaxHeight;
179 ::ll::TypedStorage<8, 64, ::std::unordered_map<::BiomeIdType, ::BiomeChunkState>> mBiomeStates;
180 ::ll::TypedStorage<2, 2, ushort> m3dBiomeStackSize;
181 ::ll::TypedStorage<1, 1, bool> mHasCachedTemperatureNoise;
182 ::ll::TypedStorage<1, 256, ::std::array<bool, 256>> mBorderBlockMap;
183 ::ll::TypedStorage<4, 4, int> mCurrentInstatick;
184 ::ll::TypedStorage<4, 4, ::LevelChunk::Finalization> mFinalized;
185 ::ll::TypedStorage<1, 1, bool> mIsRedstoneLoaded;
186 ::ll::TypedStorage<1, 1, bool> mOwnedByTickingThread;
187 ::ll::TypedStorage<1, 1, bool> mUse3DBiomeMaps;
188 ::ll::TypedStorage<1, 1, bool> mLevelChunkHas3dBiomeTag;
189 ::ll::TypedStorage<1, 4, ::LevelChunk::Telemetry> mTelemetry;
190 ::ll::TypedStorage<4, 48, ::DirtyTicksCounter[6]> mFullChunkDirtyTicksCounters;
191 ::ll::TypedStorage<4, 8, ::DirtyTicksCounter> mChunkActorsDirtyTicksCounter;
192 ::ll::TypedStorage<2, 512, ::std::array<::ChunkLocalHeight, 256>> mRainHeights;
193 ::ll::TypedStorage<8, 24, ::std::vector<::WeakEntityRef>> mEntities;
194 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mRemovedActorStorageKeys;
195 ::ll::TypedStorage<8, 136, ::LevelChunkBlockActorStorage> mBlockEntities;
196 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::BlockActor>>> mPreservedBlockEntities;
197 ::ll::TypedStorage<8, 24, ::std::vector<::WeakRef<::EntityContext>>> mVolumes;
198 ::ll::TypedStorage<1, 2, ::BrightnessPair> mDefaultBrightness;
199 ::ll::TypedStorage<8, 24, ::std::vector<::LevelChunk::SpawningArea>> mSpawningAreas;
200 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastNetworkLightingTime;
201 ::ll::TypedStorage<8, 8, uint64> mLoadedMetaDataHash;
202 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::LevelChunkMetaData>> mMetaData;
203 ::ll::TypedStorage<1, 1, bool> mClientNeedsToRequestSubChunks;
204 ::ll::TypedStorage<1, 1, bool> mLevelChunkHasHadOriginalLighting;
205 ::ll::TypedStorage<4, 16, float[2][2]> mChunkInterpolants;
206 ::ll::TypedStorage<1, 1, bool> mbChunkHasConverterTag;
207 ::ll::TypedStorage<1, 1, ::LevelChunk::Neighbors> mSavedNeighbors;
208 ::ll::TypedStorage<4, 8, ::std::optional<uint>> mGenerationSeed;
209 ::ll::TypedStorage<1, 1, bool> mGeneratedPreCavesAndCliffsBlending;
210 ::ll::TypedStorage<1, 1, bool> mOnChunkLoadedCalled;
211 ::ll::TypedStorage<1, 1, bool> mAllSerializedEntitiesLoaded;
212 ::ll::TypedStorage<8, 32, ::std::string> mOutOfBoundsEntitiesBuffer;
213 ::ll::TypedStorage<8, 32, ::std::string> mOutOfBoundsBlockEntitiesBuffer;
214 ::ll::TypedStorage<1, 1, bool> mSaveNonActorDataIfDirty;
215 ::ll::TypedStorage<1, 1, bool> mSaveIfNeverSaved;
216 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mSnowRandomValue;
217 ::ll::TypedStorage<1, 1, bool> mHasSubChunksToPrune;
218 ::ll::TypedStorage<1, 1, bool> mHaveSubChunksBeenPruned;
219 ::ll::TypedStorage<1, 1, bool> mShouldShiftUpFlatWorldSubChunks;
220 ::ll::TypedStorage<8, 32, ::SpinLockImpl> mSubChunksToPruneLock;
221 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::std::vector<::SubChunk>>> mSubChunksToPruneOutsideRange;
222 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::GameEventListenerRegistry>> mGameEventListenerRegistry;
223 ::ll::TypedStorage<1, 1, bool> mIsClientGenerated;
224 ::ll::TypedStorage<1, 1, bool> mWasClientGenerated;
225 ::ll::TypedStorage<1, 1, bool> mIsEmptyClientChunk;
226 ::ll::TypedStorage<1, 1, bool> mActorStorageUpdatedAfterCheckingForReplacementData;
227 ::ll::TypedStorage<8, 856, ::LevelChunkVolumeData> mLevelChunkVolumeData;
228 // NOLINTEND
229
230public:
231 // prevent constructor by default
232 LevelChunk& operator=(LevelChunk const&);
233 LevelChunk(LevelChunk const&);
234 LevelChunk();
235
236public:
237 // member functions
238 // NOLINTBEGIN
239 MCAPI LevelChunk(
240 ::Dimension& dimension,
241 ::ChunkPos const& cp,
242 bool readOnly,
243 ::SubChunkInitMode initBlocks,
244 bool initializeMetaData,
245 ::LevelChunkBlockActorStorage::TrackingMode blockActorTrackingMode
246 );
247
248 MCAPI void _addEntityToVolumes(::gsl::not_null<::Actor*> actor);
249
250 MCAPI void _checkAndInferMetaDataAfterDeserialization();
251
252 MCAPI ::std::shared_ptr<::BlockActor> _createBlockEntity(
253 ::BlockPos const& block,
254 ::BlockSource* currentSource,
255 ::Block const& current,
256 ::Block const& old
257 );
258
259 MCAPI void _deserializeBiomes(::IDataInput& stream, ::BiomeRegistry const& biomeRegistry, bool fromNetwork);
260
261 MCAPI void _deserializeBlockEntities(::IDataInput& stream, ::LevelChunkBlockActorStorage& blockEntityMap);
262
263 MCAPI void _deserializeCCsubChunks(short index, ::StringByteInput& stream);
264
265 MCAPI ::LevelChunk::DeserializeEntityResult
266 _deserializeEntity(::BlockSource& source, ::IDataInput& stream, ::std::vector<::ActorLink>& links);
267
268 MCAPI bool _deserializeSubChunk(short index, ::StringByteInput& stream);
269
270 MCAPI void _fixupCommandBlocksOnTickingQueue(::BlockSource& tickRegion);
271
272 MCAPI void
273 _fixupCorruptedBlockActors(::LevelChunkBlockActorStorage& deserialized, ::buffer_span_mut<::SubChunk> subchunks);
274
275 MCAPI void _generateOriginalLighting(::ChunkViewSource& neighborhood, bool enforceBorderCheck);
276
277 MCAPI void _generateOriginalLightingSubChunk(::BlockSource& source, uint64 subchunkIdx, bool);
278
279 MCAPI void _lightingCallbacks(
280 ::ChunkBlockPos const& pos,
281 ::Block const& old,
282 ::Block const& current,
283 ::BlockSource* currentSource
284 );
285
286 MCAPI void _makeUniformBiomes(::Biome const& biome);
287
288 MCAPI void _placeBlockEntity(::std::shared_ptr<::BlockActor> te);
289
290 MCAPI bool _recalcHeight(::ChunkBlockPos const& start, ::BlockSource* source);
291
292 MCAPI void _removeCallbacks(
293 ::ChunkBlockPos const& pos,
294 ::Block const& oldBlock,
295 ::Block const& current,
296 ::BlockSource* currentSource
297 );
298
299 MCAPI void _replaceBiomeStorage(
300 ushort subChunkIndex,
301 ::std::unique_ptr<::SubChunkStorage<::Biome>> newStorage,
303 );
304
305 MCAPI void _set2DBiomesFrom3D(::IDataInput& stream);
306
307 MCAPI void _setAllBiomesFrom2D(::std::array<::BiomeChunkData, 256>& legacyBiomes);
308
309 MCAPI void _setBiome(::Biome const& biome, ::ChunkBlockPos const& pos, bool fillYDimension);
310
311 MCAPI void _setBiome(
312 ::Biome const& biome,
313 ushort subChunkIndex,
314 ushort storageIndex,
316 );
317
318 MCAPI void _tickSnowAndIce(::BlockSource& region, ::Random& random, int xOffset, int zOffset, ::Weather& weather);
319
320 MCAPI void addEntity(::WeakEntityRef entityRef);
321
322 MCAPI void addHardcodedSpawningArea(::BoundingBox const& spawnerAABB, ::HardcodedSpawnAreaType type);
323
324 MCAPI void addSubChunkBlockEntitiesToLevelChunk(::LevelChunkBlockActorStorage& blockActorMap);
325
326 MCAPI bool applySeasonsPostProcess(::BlockSource& region);
327
328 MCAPI bool checkSeasonsPostProcessDirty();
329
330 MCAPI void clientSubChunkRequestGenerateLightingForSubChunk(::ChunkViewSource& neighborhood, short absoluteIndex);
331
332 MCAPI void deserialize2DMaps(::IDataInput& stream);
333
334 MCAPI void deserializeBlockEntities(::IDataInput& stream);
335
336 MCAPI bool deserializeKey(::std::string_view key, ::std::string_view value);
337
338 MCAPI void deserializeMetaDataHash(::IDataInput& stream);
339
340 MCAPI void deserializeSubChunk(
341 uchar idx,
342 ::IDataInput& stream,
343 ::std::optional<schar> absoluteIndex,
344 ::std::optional<::DeserializationChanges*> deserializationChanges
345 );
346
347 MCAPI void fetchBiomes(::Bedrock::small_vector_base<::Biome const*>& output) const;
348
349 MCAPI void fillBiomes(::BiomeChunkData const& biomeChunkData);
350
351 MCAPI void finalizeDeserialization();
352
353 MCAPI void finalizePostProcessing();
354
355 MCAPI void finalizeSubChunkDeserialization(
356 ::LevelChunkBlockActorStorage& blockActorMap,
358 );
359
360 MCAPI ::std::optional<::BlockPos> findExposedLightningRod(::BlockPos const& pos, ::BlockSource& region);
361
362 MCAPI ::Vec3 findLightningTarget(::BlockPos const& pos, ::BlockSource& region);
363
364 MCAPI bool generateOriginalLighting(::ChunkViewSource& neighborhood, bool enforceBorderCheck);
365
366 MCAPI ::ChunkLocalHeight getAboveTopSolidBlock(
367 ::ChunkBlockPos const& start,
368 bool iteratePastInitialBlocking,
369 bool includeWater,
370 bool includeLeaves
371 ) const;
372
373 MCAPI void getActors(
374 ::ActorDefinitionIdentifier const& actorDefinitionId,
375 ::AABB const& bb,
376 ::std::vector<::Actor*>& actors
377 ) const;
378
379 MCAPI ::Biome const& getBiome(::ChunkBlockPos const& pos) const;
380
381 MCAPI ::Block const& getBlock(::ChunkBlockPos const& pos) const;
382
383 MCAPI ::BlockActor* getBlockEntity(::ChunkBlockPos const& localPos);
384
385 MCAPI ::BrightnessPair getBrightness(::ChunkBlockPos const& pos) const;
386
387 MCAPI void getEntities(
388 ::gsl::span<::gsl::not_null<::Actor const*>> ignoredEntities,
389 ::AABB const& bb,
390 ::std::vector<::Actor*>& entities,
391 bool useHitbox
392 ) const;
393
394 MCAPI void
395 getEntities(::ActorType type, ::AABB const& bb, ::std::vector<::Actor*>& es, bool ignoreTargetType) const;
396
397 MCAPI ::Block const& getExtraBlock(::ChunkBlockPos const& localPos) const;
398
399 MCAPI short getHighestNonAirSubChunkIndex() const;
400
401 MCAPI ::std::shared_ptr<::LevelChunkMetaData> getMetaDataCopy() const;
402
403 MCAPI ::BlockPos const getTopRainBlockPos(::ChunkBlockPos const& pos);
404
405 MCAPI bool hasEntity(::WeakEntityRef entityRef);
406
407 MCAPI bool hasSubChunksToPrune() const;
408
409 MCAPI bool isNonActorDataDirty() const;
410
411 MCAPI void legacyDeserializeBlockExtraData(::IDataInput& stream);
412
413 MCAPI void legacyDeserializeTerrain(::IDataInput& stream);
414
415 MCAPI void markForTickingThisFrame(::LevelChunkTicking::Registry& registry);
416
417 MCAPI ::LevelChunk& operator=(::LevelChunk&& otherChunk);
418
419 MCAPI void placeCallbacks(
420 ::ChunkBlockPos const& pos,
421 ::Block const& old,
422 ::Block const& current,
423 ::BlockSource* currentSource,
424 ::std::shared_ptr<::BlockActor> blockEntity
425 );
426
427 MCAPI void populateHeightMapDataForSubChunkPacket(
428 short subChunkAbsoluteIndex,
429 ::SubChunkPacket::SubChunkPacketData& subChunkPacketData
430 ) const;
431
432 MCAPI void recomputeHeightMap(bool resetLighting);
433
434 MCAPI bool removeEntityFromChunk(::WeakEntityRef entityRef);
435
436 MCAPI bool removeEntityFromWorld(::WeakEntityRef entityRef);
437
438 MCAPI void removeHardcodedSpawningArea(::HardcodedSpawnAreaType type);
439
440 MCAPI void serializeBiomes(::IDataOutput& stream) const;
441
442 MCAPI void serializeBlockEntities(::IDataOutput& stream, ::SaveContext const& saveContext) const;
443
444 MCAPI void serializeBlockEntitiesForSubChunk(
445 ::IDataOutput& stream,
446 ::SubChunkPos const& subChunkPos,
447 ::SaveContext const& saveContext
448 ) const;
449
450 MCAPI bool serializeBorderBlocks(::IDataOutput& stream) const;
451
452 MCAPI void serializeEntities(
453 ::std::string& buffer,
454 bool markProcessedOnChunkDisard,
455 ::std::function<void(::std::string const&)> addLiveActorCallback,
456 ::std::function<void(::std::string const&)> addActorKeyCallback,
457 ::std::function<void(::std::string const&)> addSerializedActor
458 ) const;
459
460 MCAPI void serializeEntityRemovals(::std::function<void(::std::string const&)> callback);
461
462 MCAPI void setAllBlockTypeIDAndData(::buffer_span<::BlockID> ids, ::buffer_span<::NibblePair> data);
463
464 MCAPI void setBiomeFromVolume(::ClientBlockPipeline::VolumeOf<::Biome const*> const& volume);
465
466 MCAPI ::Block const& setBlock(
467 ::ChunkBlockPos const& pos,
468 ::Block const& block,
469 ::BlockSource* issuingSource,
470 ::std::shared_ptr<::BlockActor> blockEntity
471 );
472
473 MCAPI void setBlockVolume(::BlockVolume const& box, uint yOffset);
474
475 MCAPI ::Block const&
476 setExtraBlock(::ChunkBlockPos const& localPos, ::Block const& block, ::BlockSource* issuingSource);
477
478 MCAPI void setMetaData(::std::shared_ptr<::LevelChunkMetaData> metaData);
479
480 MCAPI void setPendingEntities(::std::string entitiesData);
481
482 MCAPI void setPreWorldGenHeightMap(::std::unique_ptr<::std::vector<short>> heightmap);
483
484 MCAPI void setSaved();
485
486 MCAPI void setUnsaved();
487
488 MCAPI void setupRedstoneCircuit(::BlockSource& resource);
489
490 MCAPI void tickBlockEntities(::BlockSource& tickRegion);
491
492 MCAPI void tickBlocks(::BlockSource& region);
493
494 MCAPI void tickImpl(::BlockSource& tickRegion, ::Tick const& tick, ::std::function<void()> spawnerCallback);
495
496 MCAPI void trySpawnSkeletonTrap(::BlockSource& region, ::BlockPos const& pos);
497
498 MCAPI void validateAndFixBiomeStates();
499
500 MCAPI ~LevelChunk();
501 // NOLINTEND
502
503public:
504 // static functions
505 // NOLINTBEGIN
506 MCAPI static ::std::pair<ushort, ::std::vector<::std::unique_ptr<::SubChunkStorage<::Biome>>>> deserialize3DBiomes(
507 ::IDataInput& stream,
508 ::BiomeRegistry const& biomeRegistry,
509 ushort dimensionHeightInSubchunks,
510 ::Biome const* defaultBiome,
511 bool fromNetwork
512 );
513
514 MCAPI static void serializeEntities(
515 ::std::vector<::WeakEntityRef> const& entities,
516 ::std::string const& serializedEntitiesBuffer,
517 ::std::string const& failedSerializedEntitiesBuffer,
518 ::std::string& buffer,
519 bool markProcessedOnChunkDisard,
520 ::std::function<void(::std::string const&)> addLiveActorCallback,
521 ::std::function<void(::std::string const&)> addActorKeyCallback,
522 ::std::function<void(::std::string const&)> addSerializedActor
523 );
524
525 MCAPI static ::std::
526 tuple<::std::array<::ChunkLocalHeight, 256>, ::std::array<::BiomeChunkData, 256>, ::std::vector<::SubChunk>>
527 staticDeserializeLegacyTerrain(::IDataInput& stream, short minY, ushort dimensionSizeInSubchunks);
528 // NOLINTEND
529
530public:
531 // constructor thunks
532 // NOLINTBEGIN
533 MCAPI void* $ctor(
534 ::Dimension& dimension,
535 ::ChunkPos const& cp,
536 bool readOnly,
537 ::SubChunkInitMode initBlocks,
538 bool initializeMetaData,
539 ::LevelChunkBlockActorStorage::TrackingMode blockActorTrackingMode
540 );
541 // NOLINTEND
542
543public:
544 // destructor thunk
545 // NOLINTBEGIN
546 MCAPI void $dtor();
547 // NOLINTEND
548};
Definition AABB.h:18
Definition Actor.h:102
Definition UniqueLock.h:8
Definition small_vector_base.h:8
Definition small_vector.h:8
Definition BiomeRegistry.h:35
Definition Biome.h:23
Definition BlockActor.h:32
Definition BlockPos.h:17
Definition BlockSource.h:66
Definition BlockTickingQueue.h:24
Definition BlockVolume.h:13
Definition Block.h:37
Definition BoundingBox.h:13
Definition ChunkBlockPos.h:10
Definition ChunkPos.h:11
Definition ChunkSource.h:34
Definition ChunkViewSource.h:22
Definition VolumeOf.h:8
Definition Dimension.h:83
Definition EntityContext.h:16
Definition GameEventListenerRegistry.h:10
Definition IDataInput.h:8
Definition IDataOutput.h:5
Definition ILevel.h:207
Definition LevelChunkBlockActorStorage.h:14
Definition LevelChunkMetaData.h:8
Definition LevelChunk.h:95
static MCAPI ::std::array<::std::pair<::LevelChunkNeighbor, ::ChunkPos >, 8 > const & sOffsetMap()
Definition LevelChunk.h:77
Definition Random.h:10
Definition SaveContext.h:5
Definition StringByteInput.h:9
Definition SubChunkPos.h:5
Definition SubChunkStorage.h:9
Definition Vec3.h:10
Definition WeakEntityRef.h:14
Definition Weather.h:19
Definition _HeaderOutputPredefine.h:195
Definition buffer_span.h:6
Definition ActorDefinitionIdentifier.h:15
Definition BiomeChunkData.h:8
Definition BiomeChunkState.h:5
Definition BlockID.h:8
Definition DeserializationChanges.h:5
Definition Registry.h:10
Definition LevelChunk.h:124
Definition LevelChunk.h:109
Definition NibblePair.h:5
Definition SubChunkPacket.h:76
Definition SubChunk.h:24
Definition Tick.h:5
Definition buffer.h:5