LeviLamina
Loading...
Searching...
No Matches
ItemStackNetManagerBase.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/game_refs/OwnerPtr.h"
7#include "mc/deps/game_refs/WeakRef.h"
8#include "mc/deps/shared_types/legacy/ContainerType.h"
9#include "mc/world/inventory/network/TypedClientNetId.h"
10
11// auto generated forward declare list
12// clang-format off
13class BlockSource;
16class EntityRegistry;
17class ItemStack;
21class Player;
22class SparseContainer;
26// clang-format on
27
28class ItemStackNetManagerBase {
29public:
30 // ItemStackNetManagerBase inner types define
31 using BaseContainerSetter = ::std::function<void(::ItemStack const&)>;
32
33 using LegacyRequestScope = ::gsl::final_action<::std::function<void()>>;
34
35public:
36 // member variables
37 // NOLINTBEGIN
38 ::ll::TypedStorage<1, 1, bool const> mIsEnabled;
39 ::ll::TypedStorage<1, 1, bool const> mIsClientSide;
40 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
41 ::ll::TypedStorage<8, 16, ::WeakRef<::EntityRegistry>> mLevelWeakRegistry;
42 ::ll::TypedStorage<8, 16, ::OwnerPtr<::EntityRegistry>> mEntityRegistry;
43 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackNetManagerScreenStack>> mScreenStack;
44 ::ll::TypedStorage<1, 1, bool> mCurrentRequestHasCraftAction;
45 ::ll::TypedStorage<8, 16, ::ItemStackLegacyRequestId> mLegacyTransactionRequestId;
46 // NOLINTEND
47
48public:
49 // prevent constructor by default
50 ItemStackNetManagerBase& operator=(ItemStackNetManagerBase const&);
51 ItemStackNetManagerBase(ItemStackNetManagerBase const&);
52 ItemStackNetManagerBase();
53
54public:
55 // virtual functions
56 // NOLINTBEGIN
57 virtual ~ItemStackNetManagerBase();
58
59 virtual bool isEnabled() const;
60
61 virtual ::ItemStackRequestId getRequestId() const = 0;
62
63 virtual bool retainSetItemStackNetIdVariant() const;
64
65 virtual bool allowInventoryTransactionManager() const = 0;
66
67 virtual ::gsl::final_action<::std::function<void()>> _tryBeginClientLegacyTransactionRequest();
68
69 virtual void onContainerScreenOpen(::ContainerScreenContext const& screenContext);
70
71 virtual void onContainerScreenClose();
72
73#ifdef LL_PLAT_S
74 virtual ::SparseContainer* initOpenContainer(::BlockSource&, ::FullContainerName const&, ::ContainerWeakRef const&);
75#else // LL_PLAT_C
76 virtual ::SparseContainer* initOpenContainer(
77 ::BlockSource& region,
78 ::FullContainerName const& openContainerId,
79 ::ContainerWeakRef const& containerWeakRef
80 );
81#endif
82
83#ifdef LL_PLAT_S
84 virtual void _addLegacyTransactionRequestSetItemSlot(
86 ::SharedTypes::Legacy::ContainerType containerType,
87 int slot
88 );
89#else // LL_PLAT_C
90 virtual void _addLegacyTransactionRequestSetItemSlot(
92 ::SharedTypes::Legacy::ContainerType containerType,
93 int slot
94 );
95#endif
96
97 virtual void _initScreen(::ItemStackNetManagerScreen& screen);
98 // NOLINTEND
99
100public:
101 // member functions
102 // NOLINTBEGIN
103 MCAPI ItemStackNetManagerBase(::Player& player, bool isClientSide, bool isEnabled);
104
105#ifdef LL_PLAT_C
106 MCAPI bool _isRequestActionAllowed(::ItemStackRequestAction const& requestAction);
107
108 MCAPI void _pushScreen(::ContainerScreenContext screenContext);
109#endif
110
111#ifdef LL_PLAT_S
112 MCAPI void _pushScreen(::ContainerScreenContext screenContext);
113#endif
114
115 MCAPI ::ContainerScreenContext const& getScreenContext() const;
116 // NOLINTEND
117
118public:
119 // static functions
120 // NOLINTBEGIN
121 MCAPI static ::gsl::final_action<::std::function<void()>> _tryBeginClientLegacyTransactionRequest(::Player* player);
122
123 MCAPI static bool setPlayerContainer(
124 ::Player& player,
125 ::SharedTypes::Legacy::ContainerType containerType,
126 int slot,
127 ::ItemStack const& item,
128 ::ItemStack& slotItem,
129 ::std::function<void(::ItemStack const&)> const& callback
130 );
131 // NOLINTEND
132
133public:
134 // constructor thunks
135 // NOLINTBEGIN
136 MCAPI void* $ctor(::Player& player, bool isClientSide, bool isEnabled);
137 // NOLINTEND
138
139public:
140 // destructor thunk
141 // NOLINTBEGIN
142 MCAPI void $dtor();
143 // NOLINTEND
144
145public:
146 // virtual function thunks
147 // NOLINTBEGIN
148 MCFOLD bool $isEnabled() const;
149
150 MCFOLD bool $retainSetItemStackNetIdVariant() const;
151
152 MCAPI ::gsl::final_action<::std::function<void()>> $_tryBeginClientLegacyTransactionRequest();
153
154 MCAPI void $onContainerScreenOpen(::ContainerScreenContext const& screenContext);
155
156 MCAPI void $onContainerScreenClose();
157
158#ifdef LL_PLAT_S
159 MCFOLD ::SparseContainer* $initOpenContainer(::BlockSource&, ::FullContainerName const&, ::ContainerWeakRef const&);
160#else // LL_PLAT_C
161 MCFOLD ::SparseContainer* $initOpenContainer(
162 ::BlockSource& region,
163 ::FullContainerName const& openContainerId,
164 ::ContainerWeakRef const& containerWeakRef
165 );
166#endif
167
168#ifdef LL_PLAT_S
169 MCFOLD void $_addLegacyTransactionRequestSetItemSlot(
171 ::SharedTypes::Legacy::ContainerType containerType,
172 int slot
173 );
174#else // LL_PLAT_C
175 MCFOLD void $_addLegacyTransactionRequestSetItemSlot(
177 ::SharedTypes::Legacy::ContainerType containerType,
178 int slot
179 );
180#endif
181
182 MCFOLD void $_initScreen(::ItemStackNetManagerScreen& screen);
183
184
185 // NOLINTEND
186};
Definition BlockSource.h:71
Definition ContainerScreenContext.h:16
Definition ContainerWeakRef.h:17
Definition EntityRegistry.h:10
Definition ItemStackNetManagerScreenStack.h:10
Definition ItemStackNetManagerScreen.h:9
Definition ItemStackRequestAction.h:18
Definition ItemStack.h:26
Definition Player.h:129
Definition SparseContainer.h:24
Definition FullContainerName.h:8
Definition ItemStackLegacyRequestIdTag.h:5
Definition ItemStackRequestIdTag.h:5