LeviLamina
Loading...
Searching...
No Matches
ItemStackNetManagerClient.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/game_refs/WeakRef.h"
7#include "mc/deps/shared_types/legacy/ContainerType.h"
8#include "mc/world/containers/ContainerEnumName.h"
9#include "mc/world/containers/FullContainerName.h"
10#include "mc/world/inventory/ContainerWeakRef.h"
11#include "mc/world/inventory/network/ItemStackNetManagerBase.h"
12#include "mc/world/inventory/network/ItemStackRequestScreen.h"
13#include "mc/world/inventory/network/TypedClientNetId.h"
14#include "mc/world/inventory/simulation/SparseContainerBackingSetType.h"
15
16// auto generated forward declare list
17// clang-format off
18class BlockSource;
20class Container;
21class ContainerModel;
22class EntityContext;
25class ItemStack;
30class SparseContainer;
35// clang-format on
36
37class ItemStackNetManagerClient : public ::ItemStackNetManagerBase {
38public:
39 // ItemStackNetManagerClient inner types declare
40 // clang-format off
43 struct ClientScreenData;
45 // clang-format on
46
47 // ItemStackNetManagerClient inner types define
48 struct PredictiveContainer {
49 public:
50 // member variables
51 // NOLINTBEGIN
52 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::SparseContainerClient>> mSparseContainer;
53 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ItemStackRequestId, ::std::vector<::HistoricPredictionData>>>
54 mHistoricPredictions;
55 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ItemStackRequestId, ::std::vector<::HistoricPredictionData>>>
56 mZeroedOutItems;
57 // NOLINTEND
58
59#ifdef LL_PLAT_S
60#else // LL_PLAT_C
61 public:
62 // prevent constructor by default
63 PredictiveContainer();
64
65#endif
66 public:
67 // virtual functions
68 // NOLINTBEGIN
69 virtual ~PredictiveContainer() = default;
70 // NOLINTEND
71
72 public:
73 // member functions
74 // NOLINTBEGIN
75#ifdef LL_PLAT_C
76 MCNAPI PredictiveContainer(
77 ::Container& backingContainer,
78 ::SparseContainerBackingSetType backingSetType,
79 bool isItemStackNetManagerEnabled,
80 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
81 ::std::unique_ptr<::IPlayerContainerSetter> playerContainerSetter
82 );
83#endif
84 // NOLINTEND
85
86 public:
87 // constructor thunks
88 // NOLINTBEGIN
89#ifdef LL_PLAT_C
90 MCNAPI void* $ctor(
91 ::Container& backingContainer,
92 ::SparseContainerBackingSetType backingSetType,
93 bool isItemStackNetManagerEnabled,
94 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
95 ::std::unique_ptr<::IPlayerContainerSetter> playerContainerSetter
96 );
97#endif
98 // NOLINTEND
99 };
100
102 public:
103 // member variables
104 // NOLINTBEGIN
105 ::ll::TypedStorage<8, 48, ::ContainerWeakRef> mContainerWeakRef;
106 ::ll::TypedStorage<8, 8, ::ItemStackNetManagerClient::PredictiveContainer*> mContainer;
107 // NOLINTEND
108 };
109
110 struct ClientScreenData {
111 public:
112 // member variables
113 // NOLINTBEGIN
114 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ContainerEnumName, ::std::unordered_set<uchar>>>
115 mLegacyTransactionSetItemSlots;
116 ::ll::TypedStorage<
117 8,
118 64,
119 ::std::
120 unordered_map<::ItemStackRequestId, ::std::vector<::ItemStackNetManagerClient::PredictiveContainer*>>>
121 mRequestContainers;
122 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::ClientScratchContainer>>> mClientScratchContainers;
123 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::ItemStackNetManagerClient::PredictiveContainer>>>
124 mPlayerOwnedPredictiveContainers;
125 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::ItemStackNetManagerClient::PredictiveContainer>>>
126 mOpenSessionPredictiveContainers;
127 ::ll::TypedStorage<
128 8,
129 64,
130 ::std::unordered_map<::FullContainerName, ::ItemStackNetManagerClient::OpenSessionContainerData>>
131 mOpenSessionContainerMap;
132 ::ll::TypedStorage<
133 8,
134 64,
135 ::std::unordered_map<::FullContainerName, ::ItemStackNetManagerClient::OpenSessionContainerData>>
136 mHudContainerMap;
137 // NOLINTEND
138
139#ifdef LL_PLAT_S
140#else // LL_PLAT_C
141 public:
142 // prevent constructor by default
143 ClientScreenData& operator=(ClientScreenData const&);
144 ClientScreenData(ClientScreenData const&);
145 ClientScreenData();
146
147#endif
148 public:
149 // member functions
150 // NOLINTBEGIN
151#ifdef LL_PLAT_C
152 MCNAPI ClientScreenData(::ItemStackNetManagerClient::ClientScreenData&&);
153
154 MCNAPI ::ItemStackNetManagerClient::ClientScreenData&
156#endif
157 // NOLINTEND
158
159 public:
160 // constructor thunks
161 // NOLINTBEGIN
162#ifdef LL_PLAT_C
164#endif
165 // NOLINTEND
166 };
167
169 public:
170 // member variables
171 // NOLINTBEGIN
172 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContainerModel>> mOwnedContainer;
173 // NOLINTEND
174 };
175
176public:
177 // member variables
178 // NOLINTBEGIN
179 ::ll::TypedStorage<1, 1, bool> mIsHandlingResponse;
180 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackRequestData>> mRequest;
181 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackRequestBatch>> mRequestBatch;
182 ::ll::TypedStorage<8, 24, ::WeakRef<::EntityContext>> mRequestScreen;
183 // NOLINTEND
184
185public:
186 // virtual functions
187 // NOLINTBEGIN
188 virtual ~ItemStackNetManagerClient() /*override*/ = default;
189
190 virtual ::SparseContainer* initOpenContainer(
191 ::BlockSource& region,
192 ::FullContainerName const& openContainerId,
193 ::ContainerWeakRef const& containerWeakRef
194 ) /*override*/;
195
196 virtual ::ItemStackRequestId getRequestId() const /*override*/;
197
198 virtual bool allowInventoryTransactionManager() const /*override*/;
199
200 virtual ::gsl::final_action<::std::function<void()>> _tryBeginClientLegacyTransactionRequest() /*override*/;
201
202#ifdef LL_PLAT_S
203 virtual void _addLegacyTransactionRequestSetItemSlot(
205 ::SharedTypes::Legacy::ContainerType,
206 int
207 ) /*override*/;
208#else // LL_PLAT_C
209 virtual void _addLegacyTransactionRequestSetItemSlot(
211 ::SharedTypes::Legacy::ContainerType containerType,
212 int slot
213 ) /*override*/;
214#endif
215
216#ifdef LL_PLAT_S
217 virtual void _initScreen(::ItemStackNetManagerScreen&) /*override*/;
218#else // LL_PLAT_C
219 virtual void _initScreen(::ItemStackNetManagerScreen& screen) /*override*/;
220#endif
221
222 // NOLINTEND
223
224public:
225 // member functions
226 // NOLINTBEGIN
227#ifdef LL_PLAT_C
228 MCNAPI void _beginRequest(::ItemStackRequestScreen screen);
229
230 MCNAPI void _clearPredictiveContainerRequest(
231 ::ItemStackRequestId const& requestId,
233 bool shouldBeEmpty
234 );
235
236 MCNAPI void _endRequest();
237
238 MCNAPI ::std::unique_ptr<::ItemStackRequestData> _endTakeRequest();
239
240 MCNAPI ::ItemStackNetManagerClient::ClientScreenData const* _tryGetCurrentClientScreen() const;
241
242 MCNAPI ::ItemStackNetManagerClient::ClientScreenData* _tryGetCurrentClientScreen();
243
244 MCNAPI void addContainerToRequest(::ItemStackRequestId requestId, ::Container* container);
245
246 MCNAPI void addRequestAction(::std::unique_ptr<::ItemStackRequestAction> requestAction);
247
248 MCNAPI void cacheHistoricPrediction(
249 ::Container* container,
250 ::ItemStackRequestId const& requestId,
251 int slot,
252 ::ItemStack&& item
253 );
254
255 MCNAPI void
256 cacheZeroedOutItem(::Container* container, ::ItemStackRequestId const& requestId, int slot, ::ItemStack&& item);
257
258 MCNAPI void clearZeroedOutItem(::Container* container, ::ItemStackRequestId const& requestId, int slot);
259
260 MCNAPI ::std::unordered_map<::FullContainerName, ::std::shared_ptr<::Container>> getPredictiveContainers();
261
262 MCNAPI void handleItemStackResponse(::std::vector<::ItemStackResponseInfo> const& responses);
263
264 MCNAPI void trySendBatch();
265#endif
266 // NOLINTEND
267
268public:
269 // virtual function thunks
270 // NOLINTBEGIN
271#ifdef LL_PLAT_C
272 MCNAPI ::SparseContainer* $initOpenContainer(
273 ::BlockSource& region,
274 ::FullContainerName const& openContainerId,
275 ::ContainerWeakRef const& containerWeakRef
276 );
277
278 MCNAPI ::ItemStackRequestId $getRequestId() const;
279
280 MCNAPI bool $allowInventoryTransactionManager() const;
281
282 MCNAPI ::gsl::final_action<::std::function<void()>> $_tryBeginClientLegacyTransactionRequest();
283
284 MCNAPI void $_addLegacyTransactionRequestSetItemSlot(
286 ::SharedTypes::Legacy::ContainerType containerType,
287 int slot
288 );
289
290 MCNAPI void $_initScreen(::ItemStackNetManagerScreen& screen);
291#endif
292
293
294 // NOLINTEND
295
296public:
297 // vftables
298 // NOLINTBEGIN
299 MCNAPI static void** $vftable();
300 // NOLINTEND
301};
Definition BlockSource.h:71
Definition ClientScratchContainer.h:13
Definition ContainerModel.h:24
Definition ContainerWeakRef.h:17
Definition Container.h:35
Definition EntityContext.h:15
Definition IPlayerContainerSetter.h:10
Definition ISparseContainerSetListener.h:11
Definition ItemStackNetManagerClient.h:37
static MCAPI void ** $vftable()
Definition ItemStackNetManagerScreen.h:9
Definition ItemStackRequestAction.h:18
Definition ItemStackRequestBatch.h:11
Definition ItemStackRequestData.h:15
Definition ItemStack.h:26
Definition SparseContainerClient.h:20
Definition SparseContainer.h:24
STL namespace.
Definition FullContainerName.h:8
Definition HistoricPredictionData.h:8
Definition ItemStackNetManagerClient.h:110
Definition ItemStackNetManagerClient.h:101
Definition ItemStackNetManagerClient.h:168
Definition ItemStackNetManagerClient.h:48
Definition ItemStackRequestIdTag.h:5
Definition ItemStackResponseInfo.h:15