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