LeviLamina
Loading...
Searching...
No Matches
SubChunkPacketPayload.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/level/SubChunkPos.h"
7#include "mc/world/level/dimension/DimensionType.h"
8
10public:
11 // SubChunkPacketPayload inner types declare
12 // clang-format off
13 struct HeightmapData;
14 struct SubChunkPosOffset;
15 struct SubChunkPacketData;
16 // clang-format on
17
18 // SubChunkPacketPayload inner types define
19 enum class HeightMapDataType : uchar {
20 NoData = 0,
21 HasData = 1,
22 AllTooHigh = 2,
23 AllTooLow = 3,
24 AllCopied = 4,
25 };
26
27 enum class SubChunkRequestResult : uchar {
28 Undefined = 0,
29 Success = 1,
30 LevelChunkDoesntExist = 2,
31 WrongDimension = 3,
32 PlayerDoesntExist = 4,
33 IndexOutOfBounds = 5,
34 SuccessAllAir = 6,
35 };
36
37 struct HeightmapData {
38 public:
39 // member variables
40 // NOLINTBEGIN
41 ::ll::TypedStorage<1, 1, ::SubChunkPacketPayload::HeightMapDataType> mHeightMapType;
42 ::ll::TypedStorage<1, 257, ::std::optional<::std::array<::std::array<schar, 16>, 16>>> mSubchunkHeightMap;
43 ::ll::TypedStorage<1, 1, ::SubChunkPacketPayload::HeightMapDataType> mRenderHeightMapType;
44 ::ll::TypedStorage<1, 257, ::std::optional<::std::array<::std::array<schar, 16>, 16>>> mSubchunkRenderHeightMap;
45 // NOLINTEND
46
47 public:
48 HeightmapData() {
49 mHeightMapType = HeightMapDataType::NoData;
50 mRenderHeightMapType = HeightMapDataType::NoData;
51 }
52 };
53
55 public:
56 // member variables
57 // NOLINTBEGIN
58 ::ll::TypedStorage<1, 1, schar> mX;
59 ::ll::TypedStorage<1, 1, schar> mY;
60 ::ll::TypedStorage<1, 1, schar> mZ;
61 // NOLINTEND
62 };
63
64 struct SubChunkPacketData {
65 public:
66 // member variables
67 // NOLINTBEGIN
68 ::ll::TypedStorage<1, 3, ::SubChunkPacketPayload::SubChunkPosOffset> mSubChunkPosOffset;
69 ::ll::TypedStorage<1, 1, ::SubChunkPacketPayload::SubChunkRequestResult> mResult;
70 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mSerializedSubChunk;
71 ::ll::TypedStorage<1, 516, ::SubChunkPacketPayload::HeightmapData> mHeightMapData;
72 ::ll::TypedStorage<8, 16, ::std::optional<uint64>> mBlobId;
73 // NOLINTEND
74
75 public:
76 SubChunkPacketData(SubChunkPosOffset const& pos, SubChunkRequestResult requestResult) {
77 mSubChunkPosOffset = pos;
78 mResult = requestResult;
79 mSerializedSubChunk = {};
80 mHeightMapData->mHeightMapType = HeightMapDataType::NoData;
81 mHeightMapData->mRenderHeightMapType = HeightMapDataType::NoData;
82 mBlobId = 0;
83 }
84
85 SubChunkPacketData& operator=(SubChunkPacketData const& rhs) {
86 mSubChunkPosOffset = rhs.mSubChunkPosOffset;
87 mSerializedSubChunk = rhs.mSerializedSubChunk;
88 mResult = rhs.mResult;
89 mHeightMapData->mHeightMapType = rhs.mHeightMapData->mHeightMapType;
90 mHeightMapData->mRenderHeightMapType = rhs.mHeightMapData->mRenderHeightMapType;
91 mBlobId = rhs.mBlobId;
92 return *this;
93 }
94
95 SubChunkPacketData() {
96 mSubChunkPosOffset = {
97 0,
98 0,
99 0,
100 };
101 mResult = SubChunkRequestResult::Undefined;
102 mSerializedSubChunk = {};
103 mHeightMapData->mHeightMapType = HeightMapDataType::NoData;
104 mHeightMapData->mRenderHeightMapType = HeightMapDataType::NoData;
105 mBlobId = 0;
106 }
107
108 public:
109 // member functions
110 // NOLINTBEGIN
111 MCAPI bool operator==(::SubChunkPacketPayload::SubChunkPacketData const&) const;
112
113#ifdef LL_PLAT_C
114 MCAPI ~SubChunkPacketData();
115#endif
116 // NOLINTEND
117
118 public:
119 // destructor thunk
120 // NOLINTBEGIN
121#ifdef LL_PLAT_C
122 MCFOLD void $dtor();
123#endif
124 // NOLINTEND
125 };
126
127 using HeightMapArray = ::std::array<::std::array<schar, 16>, 16>;
128
129public:
130 // member variables
131 // NOLINTBEGIN
132 ::ll::TypedStorage<1, 1, bool> mCacheEnabled;
133 ::ll::TypedStorage<4, 4, ::DimensionType> mDimensionType;
134 ::ll::TypedStorage<8, 24, ::std::vector<::SubChunkPacketPayload::SubChunkPacketData>> mSubChunkData;
135 ::ll::TypedStorage<4, 12, ::SubChunkPos> mCenterPos;
136 // NOLINTEND
137};
Definition SubChunkPacketPayload.h:37
Definition SubChunkPacketPayload.h:64
Definition SubChunkPacketPayload.h:54
Definition SubChunkPacketPayload.h:9