Skip to content
LeviMC
English
AutoLightDark
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 ::ll::TypedStorage<1, 1, bool> mCursorItemDragActive;
47 // NOLINTEND
48
49public:
50 // prevent constructor by default
51 ItemStackNetManagerBase& operator=(ItemStackNetManagerBase const&);
52 ItemStackNetManagerBase(ItemStackNetManagerBase const&);
53 ItemStackNetManagerBase();
54
55public:
56 // virtual functions
57 // NOLINTBEGIN
58 virtual ~ItemStackNetManagerBase();
59
60 virtual bool isEnabled() const;
61
62 virtual ::ItemStackRequestId getRequestId() const = 0;
63
64 virtual bool retainSetItemStackNetIdVariant() const;
65
66 virtual bool allowInventoryTransactionManager() const = 0;
67
68 virtual ::gsl::final_action<::std::function<void()>> _tryBeginClientLegacyTransactionRequest();
69
70 virtual void onContainerScreenOpen(::ContainerScreenContext const& screenContext);
71
72 virtual void onContainerScreenClose();
73
74#ifdef LL_PLAT_S
75 virtual ::SparseContainer* initOpenContainer(::BlockSource&, ::FullContainerName const&, ::ContainerWeakRef const&);
76#else // LL_PLAT_C
77 virtual ::SparseContainer* initOpenContainer(
78 ::BlockSource& region,
79 ::FullContainerName const& openContainerId,
80 ::ContainerWeakRef const& containerWeakRef
81 );
82#endif
83
84 virtual void beginCursorItemDrag() = 0;
85
86 virtual void endCursorItemDrag() = 0;
87
88#ifdef LL_PLAT_S
89 virtual void _addLegacyTransactionRequestSetItemSlot(
91 ::SharedTypes::Legacy::ContainerType containerType,
92 int slot
93 );
94#else // LL_PLAT_C
95 virtual void _addLegacyTransactionRequestSetItemSlot(
97 ::SharedTypes::Legacy::ContainerType containerType,
98 int slot
99 );
100#endif
101
102 virtual void _initScreen(::ItemStackNetManagerScreen& screen);
103 // NOLINTEND
104
105public:
106 // member functions
107 // NOLINTBEGIN
108 MCNAPI ItemStackNetManagerBase(::Player& player, bool isClientSide, bool isEnabled);
109
110 MCNAPI bool _isRequestActionAllowed(::ItemStackRequestAction const& requestAction);
111
112 MCNAPI void _pushScreen(::ContainerScreenContext screenContext);
113
114 MCAPI ::ContainerScreenContext const& getScreenContext() const;
115 // NOLINTEND
116
117public:
118 // static functions
119 // NOLINTBEGIN
120 MCNAPI static bool setPlayerContainer(
121 ::Player& player,
122 ::SharedTypes::Legacy::ContainerType containerType,
123 int slot,
124 ::ItemStack const& item,
125 ::ItemStack& slotItem,
126 ::std::function<void(::ItemStack const&)> const& callback
127 );
128 // NOLINTEND
129
130public:
131 // constructor thunks
132 // NOLINTBEGIN
133 MCNAPI void* $ctor(::Player& player, bool isClientSide, bool isEnabled);
134 // NOLINTEND
135
136public:
137 // destructor thunk
138 // NOLINTBEGIN
139 MCNAPI void $dtor();
140 // NOLINTEND
141
142public:
143 // virtual function thunks
144 // NOLINTBEGIN
145 MCNAPI bool $isEnabled() const;
146
148
149 MCAPI ::gsl::final_action<::std::function<void()>> $_tryBeginClientLegacyTransactionRequest();
150
151 MCNAPI void $onContainerScreenOpen(::ContainerScreenContext const& screenContext);
152
153 MCAPI void $onContainerScreenClose();
154
155#ifdef LL_PLAT_S
156 MCNAPI ::SparseContainer* $initOpenContainer(::BlockSource&, ::FullContainerName const&, ::ContainerWeakRef const&);
157#else // LL_PLAT_C
158 MCNAPI ::SparseContainer* $initOpenContainer(
159 ::BlockSource& region,
160 ::FullContainerName const& openContainerId,
161 ::ContainerWeakRef const& containerWeakRef
162 );
163#endif
164
165#ifdef LL_PLAT_S
168 ::SharedTypes::Legacy::ContainerType containerType,
169 int slot
170 );
171#else // LL_PLAT_C
174 ::SharedTypes::Legacy::ContainerType containerType,
175 int slot
176 );
177#endif
178
180
181
182 // NOLINTEND
183};
Definition BlockSource.h:72
Definition ContainerScreenContext.h:16
Definition ContainerWeakRef.h:17
Definition EntityRegistry.h:10
MCAPI bool _isRequestActionAllowed(::ItemStackRequestAction const &requestAction)
MCAPI void $_addLegacyTransactionRequestSetItemSlot(::ItemStackNetManagerScreen &screen, ::SharedTypes::Legacy::ContainerType containerType, int slot)
MCAPI ItemStackNetManagerBase(::Player &player, bool isClientSide, bool isEnabled)
MCAPI void $_initScreen(::ItemStackNetManagerScreen &screen)
MCAPI void $onContainerScreenOpen(::ContainerScreenContext const &screenContext)
static MCAPI bool setPlayerContainer(::Player &player, ::SharedTypes::Legacy::ContainerType containerType, int slot, ::ItemStack const &item, ::ItemStack &slotItem, ::std::function< void(::ItemStack const &)> const &callback)
MCAPI bool $isEnabled() const
MCAPI void _pushScreen(::ContainerScreenContext screenContext)
MCAPI bool $retainSetItemStackNetIdVariant() const
MCAPI::SparseContainer * $initOpenContainer(::BlockSource &region, ::FullContainerName const &openContainerId, ::ContainerWeakRef const &containerWeakRef)
MCAPI void * $ctor(::Player &player, bool isClientSide, bool isEnabled)
Definition ItemStackNetManagerScreenStack.h:10
Definition ItemStackNetManagerScreen.h:9
Definition ItemStackRequestAction.h:18
Definition ItemStack.h:26
Definition Player.h:131
Definition SparseContainer.h:24
Definition FullContainerName.h:8
Definition ItemStackLegacyRequestIdTag.h:5
Definition ItemStackRequestIdTag.h:5