28 enum class BlockLayer : uchar {
34 enum class SubChunkState :
int {
37 IsLightingSystemSubChunk = 1,
39 ReceivedResponseFromServer = 3,
40 ProcessingSubChunk = 4,
41 WaitingForCacheResponse = 5,
42 ProcessedSubChunk = 6,
51 ::ll::TypedStorage<4, 8, ::DirtyTicksCounter> mDirtyTicksCounter;
52 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SubChunkBrightnessStorage>> mSkyLight;
53 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SubChunkBrightnessStorage>> mBlockLight;
54 ::ll::TypedStorage<4, 4, ::SubChunk::SubChunkState> mSubChunkState;
55 ::ll::TypedStorage<1, 1, bool> mHasMaxSkyLight;
56 ::ll::TypedStorage<1, 1, bool> mNeedsInitLighting;
57 ::ll::TypedStorage<1, 1, bool> mNeedsClientLighting;
58 ::ll::TypedStorage<8, 16, ::std::unique_ptr<::SubChunkStorage<::Block>>[2]> mBlocks;
59 ::ll::TypedStorage<8, 16, ::SubChunkStorage<::Block>* [2]> mBlocksReadPtr;
60 ::ll::TypedStorage<8, 8, ::SpinLockImpl*> mWriteLock;
61 ::ll::TypedStorage<8, 8, uint64> mHash;
62 ::ll::TypedStorage<1, 1, bool> mHashDirty;
63 ::ll::TypedStorage<1, 1, schar> mAbsoluteIndex;
64 ::ll::TypedStorage<1, 1, bool> mIsReplacementSubChunk;
65 ::ll::TypedStorage<1, 1, uchar> mRenderChunkTrackingVersionNumber;
70 SubChunk& operator=(SubChunk
const&);
71 SubChunk(SubChunk
const&);
78 MCAPI SubChunk(::SubChunk&& rhs);
81 SubChunk(
::Block const* initBlock,
bool maxSkyLight,
bool fullyLit,
::SpinLockImpl& spinLock, schar absoluteIndex);
85 MCAPI
void _createBlockLightStorage();
87 MCAPI
void _createSkyLightStorage();
91 MCAPI
void _resetLight(
bool maxSkyLight,
bool maxLight);
94 MCAPI
void _setBlock(uchar layer, ushort index,
::Block const& block);
96 MCAPI
void deserialize(
100 ::std::optional<::DeserializationChanges*> deserializationChanges
103 MCAPI
void fetchBlocks(
106 short dimensionMinHeight,
111 MCAPI
bool isPlaceHolderSubChunk()
const;
114 MCAPI ::SubChunk& operator=(::SubChunk&& rhs);
116 MCAPI
void prune(::SubChunkStorageUnit::PruneType pruneType);
118 MCAPI ::std::string recalculateHashAndSerialize(
bool network);
120 MCAPI
void reset(
::Block const* resetBlock,
bool maxSkyLight,
bool fullyLit);
122 MCAPI
void serialize(
::IDataOutput& stream,
bool network)
const;
125 MCAPI
void setBlockLight(ushort index, uchar lightValue);
128 MCAPI
void setBlocksToUniform(
::Block const& initBlock,
bool maxSkyLight,
bool fullyLit);
130 MCAPI
void setFromBlockVolume(
::BlockVolume const& box,
short height);
137 MCAPI
void setSkyLight(ushort index, uchar lightValue);
147 MCAPI
void* $ctor(::SubChunk&& rhs);
150 $ctor(
::Block const* initBlock,
bool maxSkyLight,
bool fullyLit,
::SpinLockImpl& spinLock, schar absoluteIndex);