Skip to content
LeviMC
English
AutoLightDark
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 void beginCursorItemDrag() /*override*/;
201
202 virtual void endCursorItemDrag() /*override*/;
203
204 virtual ::gsl::final_action<::std::function<void()>> _tryBeginClientLegacyTransactionRequest() /*override*/;
205
206#ifdef LL_PLAT_S
207 virtual void _addLegacyTransactionRequestSetItemSlot(
209 ::SharedTypes::Legacy::ContainerType,
210 int
211 ) /*override*/;
212#else // LL_PLAT_C
213 virtual void _addLegacyTransactionRequestSetItemSlot(
215 ::SharedTypes::Legacy::ContainerType containerType,
216 int slot
217 ) /*override*/;
218#endif
219
220#ifdef LL_PLAT_S
221 virtual void _initScreen(::ItemStackNetManagerScreen&) /*override*/;
222#else // LL_PLAT_C
223 virtual void _initScreen(::ItemStackNetManagerScreen& screen) /*override*/;
224#endif
225
226 // NOLINTEND
227
228public:
229 // member functions
230 // NOLINTBEGIN
231#ifdef LL_PLAT_C
232 MCNAPI void _beginRequest(::ItemStackRequestScreen screen);
233
234 MCNAPI void _clearPredictiveContainerRequest(
235 ::ItemStackRequestId const& requestId,
237 bool shouldBeEmpty
238 );
239
240 MCNAPI void _endRequest();
241
242 MCNAPI ::std::unique_ptr<::ItemStackRequestData> _endTakeRequest();
243
244 MCNAPI ::ItemStackNetManagerClient::ClientScreenData const* _tryGetCurrentClientScreen() const;
245
246 MCNAPI ::ItemStackNetManagerClient::ClientScreenData* _tryGetCurrentClientScreen();
247
248 MCNAPI void addContainerToRequest(::ItemStackRequestId requestId, ::Container* container);
249
250 MCNAPI void addRequestAction(::std::unique_ptr<::ItemStackRequestAction> requestAction);
251
252 MCNAPI void cacheHistoricPrediction(
253 ::Container* container,
254 ::ItemStackRequestId const& requestId,
255 int slot,
256 ::ItemStack&& item
257 );
258
259 MCNAPI void
260 cacheZeroedOutItem(::Container* container, ::ItemStackRequestId const& requestId, int slot, ::ItemStack&& item);
261
262 MCNAPI void clearZeroedOutItem(::Container* container, ::ItemStackRequestId const& requestId, int slot);
263
264 MCNAPI ::std::unordered_map<::FullContainerName, ::std::shared_ptr<::Container>> getPredictiveContainers();
265
266 MCNAPI void handleItemStackResponse(::std::vector<::ItemStackResponseInfo> const& responses);
267
268 MCNAPI void trySendBatch();
269#endif
270 // NOLINTEND
271
272public:
273 // virtual function thunks
274 // NOLINTBEGIN
275#ifdef LL_PLAT_C
276 MCNAPI ::SparseContainer* $initOpenContainer(
277 ::BlockSource& region,
278 ::FullContainerName const& openContainerId,
279 ::ContainerWeakRef const& containerWeakRef
280 );
281
282 MCNAPI ::ItemStackRequestId $getRequestId() const;
283
284 MCNAPI bool $allowInventoryTransactionManager() const;
285
286 MCNAPI void $beginCursorItemDrag();
287
288 MCNAPI void $endCursorItemDrag();
289
290 MCNAPI ::gsl::final_action<::std::function<void()>> $_tryBeginClientLegacyTransactionRequest();
291
294 ::SharedTypes::Legacy::ContainerType containerType,
295 int slot
296 );
297
298 MCNAPI void $_initScreen(::ItemStackNetManagerScreen& screen);
299#endif
300
301
302 // NOLINTEND
303
304public:
305 // vftables
306 // NOLINTBEGIN
307 MCNAPI static void** $vftable();
308 // NOLINTEND
309};
Definition BlockSource.h:72
Definition ClientScratchContainer.h:13
Definition ContainerModel.h:23
Definition ContainerWeakRef.h:17
Definition Container.h:36
Definition EntityContext.h:15
Definition IPlayerContainerSetter.h:10
Definition ISparseContainerSetListener.h:11
MCAPI void $_addLegacyTransactionRequestSetItemSlot(::ItemStackNetManagerScreen &screen, ::SharedTypes::Legacy::ContainerType containerType, int slot)
MCAPI void $_initScreen(::ItemStackNetManagerScreen &screen)
MCAPI::SparseContainer * $initOpenContainer(::BlockSource &region, ::FullContainerName const &openContainerId, ::ContainerWeakRef const &containerWeakRef)
MCAPI void * $ctor(::Player &player, bool isClientSide, bool isEnabled)
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