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<4, 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 virtual ::SparseContainer* initOpenContainer(::BlockSource&, ::FullContainerName const&, ::ContainerWeakRef const&);
74
75 virtual void _addLegacyTransactionRequestSetItemSlot(
77 ::SharedTypes::Legacy::ContainerType containerType,
78 int slot
79 );
80
81 virtual void _initScreen(::ItemStackNetManagerScreen&);
82 // NOLINTEND
83
84public:
85 // member functions
86 // NOLINTBEGIN
87 MCAPI ItemStackNetManagerBase(::Player& player, bool isClientSide, bool isEnabled);
88
89 MCAPI bool _isRequestActionAllowed(::ItemStackRequestAction const& requestAction);
90
91 MCAPI void _pushScreen(::ContainerScreenContext screenContext);
92
93 MCAPI ::ContainerScreenContext const& getScreenContext() const;
94 // NOLINTEND
95
96public:
97 // static functions
98 // NOLINTBEGIN
99 MCAPI static ::gsl::final_action<::std::function<void()>> _tryBeginClientLegacyTransactionRequest(::Player* player);
100
101 MCAPI static bool setPlayerContainer(
102 ::Player& player,
103 ::SharedTypes::Legacy::ContainerType containerType,
104 int slot,
105 ::ItemStack const& item,
106 ::ItemStack& slotItem,
107 ::std::function<void(::ItemStack const&)> const& callback
108 );
109 // NOLINTEND
110
111public:
112 // constructor thunks
113 // NOLINTBEGIN
114 MCAPI void* $ctor(::Player& player, bool isClientSide, bool isEnabled);
115 // NOLINTEND
116
117public:
118 // destructor thunk
119 // NOLINTBEGIN
120 MCAPI void $dtor();
121 // NOLINTEND
122
123public:
124 // virtual function thunks
125 // NOLINTBEGIN
126 MCFOLD bool $isEnabled() const;
127
128 MCFOLD bool $retainSetItemStackNetIdVariant() const;
129
130 MCAPI ::gsl::final_action<::std::function<void()>> $_tryBeginClientLegacyTransactionRequest();
131
132 MCFOLD void $onContainerScreenOpen(::ContainerScreenContext const& screenContext);
133
134 MCAPI void $onContainerScreenClose();
135
136 MCFOLD ::SparseContainer* $initOpenContainer(::BlockSource&, ::FullContainerName const&, ::ContainerWeakRef const&);
137
138 MCFOLD void $_addLegacyTransactionRequestSetItemSlot(
140 ::SharedTypes::Legacy::ContainerType containerType,
141 int slot
142 );
143
144 MCFOLD void $_initScreen(::ItemStackNetManagerScreen&);
145
146
147 // NOLINTEND
148
149public:
150 // vftables
151 // NOLINTBEGIN
152 MCNAPI static void** $vftable();
153 // NOLINTEND
154};
Definition BlockSource.h:68
Definition ContainerScreenContext.h:17
Definition ContainerWeakRef.h:20
Definition EntityRegistry.h:11
static MCAPI void ** $vftable()
Definition ItemStackNetManagerScreenStack.h:10
Definition ItemStackNetManagerScreen.h:9
Definition ItemStackRequestAction.h:18
Definition ItemStack.h:26
Definition Player.h:125
Definition SparseContainer.h:24
Definition FullContainerName.h:8
Definition ItemStackLegacyRequestIdTag.h:5
Definition ItemStackRequestIdTag.h:5