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