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