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/events/TextProcessingEventOrigin.h"
9#include "mc/world/containers/ContainerEnumName.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 Player;
31class SparseContainer;
41// clang-format on
42
43class ItemStackNetManagerClient : public ::ItemStackNetManagerBase {
44public:
45 // ItemStackNetManagerClient inner types declare
46 // clang-format off
49 struct ClientScreenData;
51 // clang-format on
52
53 // ItemStackNetManagerClient inner types define
54 struct PredictiveContainer {
55 public:
56 // member variables
57 // NOLINTBEGIN
58 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::SparseContainerClient>> mSparseContainer;
59 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ItemStackRequestId, ::std::vector<::HistoricPredictionData>>>
60 mHistoricPredictions;
61 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ItemStackRequestId, ::std::vector<::HistoricPredictionData>>>
62 mZeroedOutItems;
63 // NOLINTEND
64
65#ifdef LL_PLAT_S
66#else // LL_PLAT_C
67 public:
68 // prevent constructor by default
69 PredictiveContainer();
70
71#endif
72 public:
73 // virtual functions
74 // NOLINTBEGIN
75#ifdef LL_PLAT_S
76 virtual ~PredictiveContainer() = default;
77#else // LL_PLAT_C
78 virtual ~PredictiveContainer();
79#endif
80
81 // NOLINTEND
82
83 public:
84 // member functions
85 // NOLINTBEGIN
86#ifdef LL_PLAT_C
87 MCNAPI PredictiveContainer(
88 ::Container& backingContainer,
89 ::SparseContainerBackingSetType backingSetType,
90 bool isItemStackNetManagerEnabled,
91 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
92 ::std::unique_ptr<::IPlayerContainerSetter> playerContainerSetter
93 );
94#endif
95 // NOLINTEND
96
97 public:
98 // constructor thunks
99 // NOLINTBEGIN
100#ifdef LL_PLAT_C
101 MCNAPI void* $ctor(
102 ::Container& backingContainer,
103 ::SparseContainerBackingSetType backingSetType,
104 bool isItemStackNetManagerEnabled,
105 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
106 ::std::unique_ptr<::IPlayerContainerSetter> playerContainerSetter
107 );
108#endif
109 // NOLINTEND
110
111 public:
112 // destructor thunk
113 // NOLINTBEGIN
114 MCNAPI void $dtor();
115 // NOLINTEND
116
117 public:
118 // vftables
119 // NOLINTBEGIN
120 MCNAPI static void** $vftable();
121 // NOLINTEND
122 };
123
125 public:
126 // member variables
127 // NOLINTBEGIN
128 ::ll::TypedStorage<8, 48, ::ContainerWeakRef> mContainerWeakRef;
129 ::ll::TypedStorage<8, 8, ::ItemStackNetManagerClient::PredictiveContainer*> mContainer;
130 // NOLINTEND
131
132 public:
133 // member functions
134 // NOLINTBEGIN
135#ifdef LL_PLAT_C
137#endif
138 // NOLINTEND
139
140 public:
141 // destructor thunk
142 // NOLINTBEGIN
143#ifdef LL_PLAT_C
144 MCNAPI void $dtor();
145#endif
146 // NOLINTEND
147 };
148
149 struct ClientScreenData {
150 public:
151 // member variables
152 // NOLINTBEGIN
153 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ContainerEnumName, ::std::unordered_set<uchar>>>
154 mLegacyTransactionSetItemSlots;
155 ::ll::TypedStorage<
156 8,
157 64,
158 ::std::
159 unordered_map<::ItemStackRequestId, ::std::vector<::ItemStackNetManagerClient::PredictiveContainer*>>>
160 mRequestContainers;
161 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::ClientScratchContainer>>> mClientScratchContainers;
162 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::ItemStackNetManagerClient::PredictiveContainer>>>
163 mPlayerOwnedPredictiveContainers;
164 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::ItemStackNetManagerClient::PredictiveContainer>>>
165 mOpenSessionPredictiveContainers;
166 ::ll::TypedStorage<
167 8,
168 64,
169 ::std::unordered_map<::FullContainerName, ::ItemStackNetManagerClient::OpenSessionContainerData>>
170 mOpenSessionContainerMap;
171 ::ll::TypedStorage<
172 8,
173 64,
174 ::std::unordered_map<::FullContainerName, ::ItemStackNetManagerClient::OpenSessionContainerData>>
175 mHudContainerMap;
176 // NOLINTEND
177
178#ifdef LL_PLAT_S
179#else // LL_PLAT_C
180 public:
181 // prevent constructor by default
182 ClientScreenData& operator=(ClientScreenData const&);
183 ClientScreenData(ClientScreenData const&);
184
185#endif
186 public:
187 // member functions
188 // NOLINTBEGIN
189#ifdef LL_PLAT_C
190 MCNAPI ClientScreenData();
191
192 MCNAPI ClientScreenData(::ItemStackNetManagerClient::ClientScreenData&&);
193
194 MCNAPI ::ItemStackNetManagerClient::ClientScreenData&
196
197 MCNAPI ~ClientScreenData();
198#endif
199 // NOLINTEND
200
201 public:
202 // constructor thunks
203 // NOLINTBEGIN
204#ifdef LL_PLAT_C
205 MCNAPI void* $ctor();
206
208#endif
209 // NOLINTEND
210
211 public:
212 // destructor thunk
213 // NOLINTBEGIN
214#ifdef LL_PLAT_C
215 MCNAPI void $dtor();
216#endif
217 // NOLINTEND
218 };
219
220 struct OwningPredictiveContainer : public ::ItemStackNetManagerClient::PredictiveContainer {
221 public:
222 // member variables
223 // NOLINTBEGIN
224 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContainerModel>> mOwnedContainer;
225 // NOLINTEND
226
227#ifdef LL_PLAT_S
228#else // LL_PLAT_C
229 public:
230 // prevent constructor by default
231 OwningPredictiveContainer();
232
233#endif
234 public:
235 // member functions
236 // NOLINTBEGIN
237#ifdef LL_PLAT_C
238 MCNAPI OwningPredictiveContainer(
239 ::std::shared_ptr<::ContainerModel> containerModel,
240 ::Container& backingContainer,
241 ::SparseContainerBackingSetType backingSetType,
242 bool isItemStackNetManagerEnabled,
243 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
244 ::std::unique_ptr<::IPlayerContainerSetter> playerContainerSetter
245 );
246#endif
247 // NOLINTEND
248
249 public:
250 // constructor thunks
251 // NOLINTBEGIN
252#ifdef LL_PLAT_C
253 MCNAPI void* $ctor(
254 ::std::shared_ptr<::ContainerModel> containerModel,
255 ::Container& backingContainer,
256 ::SparseContainerBackingSetType backingSetType,
257 bool isItemStackNetManagerEnabled,
258 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
259 ::std::unique_ptr<::IPlayerContainerSetter> playerContainerSetter
260 );
261#endif
262 // NOLINTEND
263
264 public:
265 // vftables
266 // NOLINTBEGIN
267 MCNAPI static void** $vftable();
268 // NOLINTEND
269 };
270
271public:
272 // member variables
273 // NOLINTBEGIN
274 ::ll::TypedStorage<1, 1, bool> mIsHandlingResponse;
275 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackRequestData>> mRequest;
276 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackRequestBatch>> mRequestBatch;
277 ::ll::TypedStorage<8, 24, ::WeakRef<::EntityContext>> mRequestScreen;
278 // NOLINTEND
279
280#ifdef LL_PLAT_S
281#else // LL_PLAT_C
282public:
283 // prevent constructor by default
284 ItemStackNetManagerClient();
285
286#endif
287public:
288 // virtual functions
289 // NOLINTBEGIN
290 virtual ~ItemStackNetManagerClient() /*override*/ = default;
291
292#ifdef LL_PLAT_S
293 virtual ::SparseContainer*
294 initOpenContainer(::BlockSource&, ::FullContainerName const&, ::ContainerWeakRef const&) /*override*/;
295#else // LL_PLAT_C
296 virtual ::SparseContainer* initOpenContainer(
297 ::BlockSource& region,
298 ::FullContainerName const& openContainerId,
299 ::ContainerWeakRef const& containerWeakRef
300 ) /*override*/;
301#endif
302
303 virtual ::ItemStackRequestId getRequestId() const /*override*/;
304
305 virtual bool allowInventoryTransactionManager() const /*override*/;
306
307 virtual ::gsl::final_action<::std::function<void()>> _tryBeginClientLegacyTransactionRequest() /*override*/;
308
309#ifdef LL_PLAT_S
310 virtual void _addLegacyTransactionRequestSetItemSlot(
312 ::SharedTypes::Legacy::ContainerType,
313 int
314 ) /*override*/;
315#else // LL_PLAT_C
316 virtual void _addLegacyTransactionRequestSetItemSlot(
318 ::SharedTypes::Legacy::ContainerType containerType,
319 int slot
320 ) /*override*/;
321#endif
322
323#ifdef LL_PLAT_S
324 virtual void _initScreen(::ItemStackNetManagerScreen&) /*override*/;
325#else // LL_PLAT_C
326 virtual void _initScreen(::ItemStackNetManagerScreen& screen) /*override*/;
327#endif
328
329 // NOLINTEND
330
331public:
332 // member functions
333 // NOLINTBEGIN
334#ifdef LL_PLAT_C
335 MCNAPI ItemStackNetManagerClient(::Player& localPlayer, bool isEnabled);
336
337 MCNAPI void _beginRequest(::ItemStackRequestScreen screen);
338
339 MCNAPI void _clearPredictiveContainerRequest(
340 ::ItemStackRequestId const& requestId,
342 bool shouldBeEmpty
343 );
344
345 MCNAPI void _endRequest();
346
347 MCNAPI ::std::unique_ptr<::ItemStackRequestData> _endTakeRequest();
348
349 MCNAPI ::ItemStackLegacyRequestId _getLegacyTransactionRequest() const;
350
351 MCNAPI ::std::unordered_map<::ContainerEnumName, ::std::unordered_set<uchar>>
352 _getLegacyTransactionSetItemSlots() const;
353
354 MCNAPI void _initPlayerContainers();
355
356 MCNAPI void _processResponseSlot(
357 ::ItemStackRequestId const& requestId,
359 ::ItemStackResponseSlotInfo const& responseInfo
360 );
361
362 MCNAPI ::ItemStackNetManagerClient::ClientScreenData const* _tryGetCurrentClientScreen() const;
363
364 MCNAPI ::ItemStackNetManagerClient::ClientScreenData* _tryGetCurrentClientScreen();
365
366 MCNAPI void addContainerToRequest(::ItemStackRequestId requestId, ::Container* container);
367
368 MCNAPI void addRequestAction(::std::unique_ptr<::ItemStackRequestAction> requestAction);
369
370 MCNAPI int addRequestToFilterString(::std::string const& stringToFilter, ::TextProcessingEventOrigin origin);
371
372 MCNAPI void cacheHistoricPrediction(
373 ::Container* container,
374 ::ItemStackRequestId const& requestId,
375 int slot,
376 ::ItemStack&& item
377 );
378
379 MCNAPI void
380 cacheZeroedOutItem(::Container* container, ::ItemStackRequestId const& requestId, int slot, ::ItemStack&& item);
381
382 MCNAPI void clearZeroedOutItem(::Container* container, ::ItemStackRequestId const& requestId, int slot);
383
384 MCNAPI ::std::unordered_map<::FullContainerName, ::std::shared_ptr<::Container>> getPredictiveContainers();
385
386 MCNAPI void handleItemStackResponse(::std::vector<::ItemStackResponseInfo> const& responses);
387
388 MCNAPI bool hasActiveRequest() const;
389
390 MCNAPI ::OwnedItemStackRequestScope
391 tryBeginOwnedRequest(::std::shared_ptr<::ItemStackRequestData> result, ::ItemStackRequestScreen screen);
392
393 MCNAPI ::ItemStackRequestScope tryBeginRequest();
394
395 MCNAPI void trySendBatch();
396#endif
397 // NOLINTEND
398
399public:
400 // constructor thunks
401 // NOLINTBEGIN
402#ifdef LL_PLAT_C
403 MCNAPI void* $ctor(::Player& localPlayer, bool isEnabled);
404#endif
405 // NOLINTEND
406
407public:
408 // virtual function thunks
409 // NOLINTBEGIN
410#ifdef LL_PLAT_C
411 MCNAPI ::SparseContainer* $initOpenContainer(
412 ::BlockSource& region,
413 ::FullContainerName const& openContainerId,
414 ::ContainerWeakRef const& containerWeakRef
415 );
416
417 MCNAPI ::ItemStackRequestId $getRequestId() const;
418
419 MCNAPI bool $allowInventoryTransactionManager() const;
420
421 MCNAPI ::gsl::final_action<::std::function<void()>> $_tryBeginClientLegacyTransactionRequest();
422
423 MCNAPI void $_addLegacyTransactionRequestSetItemSlot(
425 ::SharedTypes::Legacy::ContainerType containerType,
426 int slot
427 );
428
429 MCNAPI void $_initScreen(::ItemStackNetManagerScreen& screen);
430#endif
431
432
433 // NOLINTEND
434
435public:
436 // vftables
437 // NOLINTBEGIN
438 MCNAPI static void** $vftable();
439 // NOLINTEND
440};
Definition BlockSource.h:72
Definition ClientScratchContainer.h:14
Definition ContainerModel.h:28
Definition ContainerWeakRef.h:20
Definition Container.h:34
Definition EntityContext.h:17
Definition IPlayerContainerSetter.h:10
Definition ISparseContainerSetListener.h:11
static MCAPI void ** $vftable()
Definition ItemStackNetManagerScreen.h:9
Definition ItemStackRequestAction.h:18
Definition ItemStackRequestBatch.h:15
Definition ItemStackRequestData.h:20
Definition ItemStack.h:35
Definition Player.h:136
Definition SparseContainerClient.h:24
Definition SparseContainer.h:24
STL namespace.
Definition FullContainerName.h:8
Definition HistoricPredictionData.h:8
Definition ItemStackLegacyRequestIdTag.h:5
Definition ItemStackNetManagerClient.h:149
Definition ItemStackNetManagerClient.h:124
Definition ItemStackNetManagerClient.h:220
Definition ItemStackNetManagerClient.h:54
Definition ItemStackRequestIdTag.h:5
Definition ItemStackRequestScope.h:16
Definition ItemStackResponseInfo.h:15
Definition ItemStackResponseSlotInfo.h:14
Definition OwnedItemStackRequestScope.h:15