31 enum class BlockLayer : uchar {
37 enum class SubChunkState :
int {
40 IsLightingSystemSubChunk = 1,
42 ReceivedResponseFromServer = 3,
43 ProcessingSubChunk = 4,
44 WaitingForCacheResponse = 5,
45 ProcessedSubChunk = 6,
54 ::ll::TypedStorage<4, 8, ::DirtyTicksCounter> mDirtyTicksCounter;
55 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SubChunkBrightnessStorage>> mSkyLight;
56 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SubChunkBrightnessStorage>> mBlockLight;
57 ::ll::TypedStorage<4, 4, ::SubChunk::SubChunkState> mSubChunkState;
58 ::ll::TypedStorage<1, 1, bool> mHasMaxSkyLight;
59 ::ll::TypedStorage<1, 1, bool> mNeedsInitLighting;
60 ::ll::TypedStorage<1, 1, bool> mNeedsClientLighting;
61 ::ll::TypedStorage<8, 16, ::std::unique_ptr<::SubChunkStorage<::Block>>[2]> mBlocks;
62 ::ll::TypedStorage<8, 16, ::SubChunkStorage<::Block>* [2]> mBlocksReadPtr;
63 ::ll::TypedStorage<8, 8, ::SpinLockImpl*> mWriteLock;
64 ::ll::TypedStorage<8, 8, uint64> mHash;
65 ::ll::TypedStorage<1, 1, bool> mHashDirty;
66 ::ll::TypedStorage<1, 1, schar> mAbsoluteIndex;
67 ::ll::TypedStorage<1, 1, bool> mIsReplacementSubChunk;
68 ::ll::TypedStorage<1, 1, uchar> mRenderChunkTrackingVersionNumber;
73 SubChunk& operator=(SubChunk
const&);
74 SubChunk(SubChunk
const&);
81 MCAPI SubChunk(::SubChunk&& rhs);
84 SubChunk(
::Block const* initBlock,
bool maxSkyLight,
bool fullyLit,
::SpinLockImpl& spinLock, schar absoluteIndex);
86 MCAPI ::std::unique_ptr<::SubChunkStorage<::Block>> _compareSubChunkStorageForLightingFixUp(
94 MCAPI
void _createBlockLightStorage();
96 MCAPI
void _createSkyLightStorage();
100 MCAPI
void _resetLight(
bool maxSkyLight,
bool maxLight);
103 MCAPI
void _setBlock(uchar layer, ushort index,
::Block const& block);
105 MCAPI
void deserialize(
109 ::std::optional<::DeserializationChanges*> deserializationChanges
112 MCAPI
void fetchBlocks(
115 short dimensionMinHeight,
119 MCAPI
void fetchBlocksInBox(
126 MCAPI
void fetchBlocksInCylinder(
135 MCFOLD schar getAbsoluteIndex()
const;
137 MCAPI ::Block
const& getBlock(ushort index)
const;
139 MCAPI ::Block
const& getExtraBlock(ushort index)
const;
141 MCAPI ::SubChunkBrightnessStorage::LightPair getLight(ushort idx)
const;
144 MCFOLD ::SpinLockImpl& getLock()
const;
146 MCAPI uchar getRenderChunkTrackingVersionNumber()
const;
149 MCFOLD ::SubChunk::SubChunkState getSubChunkState()
const;
151 MCAPI
bool hasAnyBlockMatchingFilter(::std::function<
bool(
::Block const&)>
const& predicate)
const;
153 MCAPI
void initialize(
161 MCAPI
bool isEmpty()
const;
163 MCAPI
bool isEmpty(::SubChunk::BlockLayer layer)
const;
165 MCAPI
bool isPaletteUniform(
::Block const& block)
const;
167 MCAPI
bool isPlaceHolderSubChunk()
const;
169 MCAPI
bool isReadPtrEmpty(::SubChunk::BlockLayer layer)
const;
171 MCFOLD
bool isReplacementSubChunk()
const;
173 MCAPI
bool isUniform(
::Block const& block)
const;
175 MCFOLD
bool likelyHasNonUniformBlockLight()
const;
178 MCFOLD
bool needsClientLighting()
const;
181 MCFOLD
bool needsInitLighting()
const;
183 MCAPI ::SubChunk& operator=(::SubChunk&& rhs);
187 MCAPI
void prune(::SubChunkStorageUnit::PruneType pruneType);
189 MCAPI
void recalculateHash(
bool network);
191 MCAPI ::std::string recalculateHashAndSerialize(
bool network);
193 MCAPI
void reset(
::Block const* resetBlock,
bool maxSkyLight,
bool fullyLit);
195 MCAPI
bool safeToModify()
const;
197 MCAPI
void serialize(
::IDataOutput& stream,
bool network)
const;
199 MCFOLD
void setAbsoluteIndex(schar index);
201 MCAPI
void setAllIsMaxSkyLight();
203 MCAPI
void setAllIsNoSkyLight();
205 MCAPI
void setBlock(ushort index,
::Block const& block);
208 MCAPI
void setBlockLight(ushort index, uchar lightValue);
211 MCAPI
void setBlocksToUniform(
::Block const& initBlock,
bool maxSkyLight,
bool fullyLit);
213 MCAPI
void setExtraBlock(ushort index,
::Block const& block);
215 MCAPI
void setFromBlockVolume(
::BlockVolume const& box,
short height);
218 MCFOLD
void setIsReplacementSubChunk(
bool isReplacement);
223 MCAPI
void setNeedsClientLighting(
bool state);
225 MCAPI
void setNeedsInitLighting(
bool state);
228 MCFOLD
void setRenderChunkTrackingVersionNumber(uchar versionNumber);
231 MCAPI
void setSkyLight(ushort index, uchar lightValue);
234 MCFOLD
void setSubChunkState(::SubChunk::SubChunkState subChunkState);
243 MCAPI
static void flushGarbageCollectors();
251 MCAPI
void* $ctor(::SubChunk&& rhs);
254 $ctor(
::Block const* initBlock,
bool maxSkyLight,
bool fullyLit,
::SpinLockImpl& spinLock, schar absoluteIndex);