LeviLamina
Loading...
Searching...
No Matches
SubChunkPacket.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/network/MinecraftPacketIds.h"
7#include "mc/network/Packet.h"
8#include "mc/platform/Result.h"
9#include "mc/world/level/SubChunkPos.h"
10#include "mc/world/level/dimension/DimensionType.h"
11
12// auto generated forward declare list
13// clang-format off
14class BinaryStream;
16// clang-format on
17
18class SubChunkPacket : public ::Packet {
19public:
20 // SubChunkPacket inner types declare
21 // clang-format off
22 struct HeightmapData;
23 struct SubChunkPosOffset;
24 struct SubChunkPacketData;
25 // clang-format on
26
27 // SubChunkPacket inner types define
28 enum class HeightMapDataType : uchar {
29 NoData = 0,
30 HasData = 1,
31 AllTooHigh = 2,
32 AllTooLow = 3,
33 AllCopied = 4,
34 };
35
36 enum class SubChunkRequestResult : uchar {
37 Undefined = 0,
38 Success = 1,
39 LevelChunkDoesntExist = 2,
40 WrongDimension = 3,
41 PlayerDoesntExist = 4,
42 IndexOutOfBounds = 5,
43 SuccessAllAir = 6,
44 };
45
46 struct HeightmapData {
47 public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<1, 1, ::SubChunkPacket::HeightMapDataType> mHeightMapType;
51 ::ll::TypedStorage<1, 256, ::std::array<::std::array<schar, 16>, 16>> mSubchunkHeightMap;
52 ::ll::TypedStorage<1, 1, ::SubChunkPacket::HeightMapDataType> mRenderHeightMapType;
53 ::ll::TypedStorage<1, 256, ::std::array<::std::array<schar, 16>, 16>> mSubchunkRenderHeightMap;
54 // NOLINTEND
55
56 public:
57 HeightmapData() {
58 mHeightMapType = HeightMapDataType::NoData;
59 mRenderHeightMapType = HeightMapDataType::NoData;
60 }
61
62 public:
63 // static variables
64 // NOLINTBEGIN
65 MCAPI static schar const& HEIGHT_COLUMN_ABOVE_SUBCHUNK();
66
67 MCAPI static schar const& HEIGHT_COLUMN_BELOW_SUBCHUNK();
68 // NOLINTEND
69 };
70
72 public:
73 // member variables
74 // NOLINTBEGIN
75 ::ll::TypedStorage<1, 1, schar> mX;
76 ::ll::TypedStorage<1, 1, schar> mY;
77 ::ll::TypedStorage<1, 1, schar> mZ;
78 // NOLINTEND
79 };
80
81 struct SubChunkPacketData {
82 public:
83 // member variables
84 // NOLINTBEGIN
85 ::ll::TypedStorage<1, 3, ::SubChunkPacket::SubChunkPosOffset const> mSubChunkPosOffset;
86 ::ll::TypedStorage<8, 32, ::std::string> mSerializedSubChunk;
87 ::ll::TypedStorage<1, 1, ::SubChunkPacket::SubChunkRequestResult> mResult;
88 ::ll::TypedStorage<1, 514, ::SubChunkPacket::HeightmapData> mHeightMapData;
89 ::ll::TypedStorage<8, 8, uint64> mBlobId;
90 // NOLINTEND
91
92 public:
93 SubChunkPacketData(SubChunkPosOffset const& pos, SubChunkRequestResult requestResult) {
94 mSubChunkPosOffset = pos;
95 mResult = requestResult;
96 mSerializedSubChunk = {};
97 mHeightMapData->mHeightMapType = HeightMapDataType::NoData;
98 mHeightMapData->mRenderHeightMapType = HeightMapDataType::NoData;
99 mBlobId = 0;
100 }
101
102 SubChunkPacketData& operator=(SubChunkPacketData const& rhs) {
103 mSubChunkPosOffset = rhs.mSubChunkPosOffset;
104 mSerializedSubChunk = rhs.mSerializedSubChunk;
105 mResult = rhs.mResult;
106 mHeightMapData->mHeightMapType = rhs.mHeightMapData->mHeightMapType;
107 mHeightMapData->mRenderHeightMapType = rhs.mHeightMapData->mRenderHeightMapType;
108 mBlobId = rhs.mBlobId;
109 return *this;
110 }
111
112 SubChunkPacketData() {
113 mSubChunkPosOffset = {
114 0,
115 0,
116 0,
117 };
118 mResult = SubChunkRequestResult::Undefined;
119 mSerializedSubChunk = {};
120 mHeightMapData->mHeightMapType = HeightMapDataType::NoData;
121 mHeightMapData->mRenderHeightMapType = HeightMapDataType::NoData;
122 mBlobId = 0;
123 }
124
125 public:
126 // member functions
127 // NOLINTBEGIN
128 MCAPI SubChunkPacketData(::SubChunkPacket::SubChunkPacketData const&);
129
130 MCAPI ~SubChunkPacketData();
131 // NOLINTEND
132
133 public:
134 // constructor thunks
135 // NOLINTBEGIN
136 MCAPI void* $ctor(::SubChunkPacket::SubChunkPacketData const&);
137 // NOLINTEND
138
139 public:
140 // destructor thunk
141 // NOLINTBEGIN
142 MCFOLD void $dtor();
143 // NOLINTEND
144 };
145
146public:
147 // member variables
148 // NOLINTBEGIN
149 ::ll::TypedStorage<1, 1, bool> mCacheEnabled;
150 ::ll::TypedStorage<4, 4, ::DimensionType> mDimensionType;
151 ::ll::TypedStorage<8, 24, ::std::vector<::SubChunkPacket::SubChunkPacketData>> mSubChunkData;
152 ::ll::TypedStorage<4, 12, ::SubChunkPos> mCenterPos;
153 // NOLINTEND
154
155public:
156 // virtual functions
157 // NOLINTBEGIN
158 virtual ~SubChunkPacket() /*override*/;
159
160 virtual ::MinecraftPacketIds getId() const /*override*/;
161
162 virtual ::std::string_view getName() const /*override*/;
163
164 virtual void write(::BinaryStream& stream) const /*override*/;
165
166 virtual ::Bedrock::Result<void> _read(::ReadOnlyBinaryStream& stream) /*override*/;
167 // NOLINTEND
168
169public:
170 // member functions
171 // NOLINTBEGIN
172 MCAPI SubChunkPacket();
173
174 MCAPI SubChunkPacket(::DimensionType const& dimension, ::SubChunkPos const& centerPos, bool cacheEnabled);
175 // NOLINTEND
176
177public:
178 // constructor thunks
179 // NOLINTBEGIN
180 MCAPI void* $ctor();
181
182 MCAPI void* $ctor(::DimensionType const& dimension, ::SubChunkPos const& centerPos, bool cacheEnabled);
183 // NOLINTEND
184
185public:
186 // destructor thunk
187 // NOLINTBEGIN
188 MCAPI void $dtor();
189 // NOLINTEND
190
191public:
192 // virtual function thunks
193 // NOLINTBEGIN
194 MCAPI ::MinecraftPacketIds $getId() const;
195
196 MCAPI ::std::string_view $getName() const;
197
198 MCAPI void $write(::BinaryStream& stream) const;
199
200 MCAPI ::Bedrock::Result<void> $_read(::ReadOnlyBinaryStream& stream);
201
202
203 // NOLINTEND
204
205public:
206 // vftables
207 // NOLINTBEGIN
208 MCNAPI static void** $vftable();
209 // NOLINTEND
210};
Definition BinaryStream.h:11
Definition ReadOnlyBinaryStream.h:8
static MCAPI void ** $vftable()
Definition SubChunkPos.h:5
STL namespace.
Definition DimensionType.h:5
Definition SubChunkPacket.h:46
Definition SubChunkPacket.h:81
Definition SubChunkPacket.h:71