LeviLamina
Loading...
Searching...
No Matches
PlayerInventory.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/ContainerContentChangeListener.h"
7#include "mc/world/ContainerID.h"
8#include "mc/world/ContainerSizeChangeListener.h"
9#include "mc/world/item/ItemStack.h"
10
11// auto generated forward declare list
12// clang-format off
13class Container;
15class Inventory;
17// clang-format on
18
20public:
21 // member variables
22 // NOLINTBEGIN
23 ::ll::TypedStorage<4, 4, int> mSelected;
24 ::ll::TypedStorage<8, 152, ::ItemStack> mInfiniteItem;
25 ::ll::TypedStorage<1, 1, ::ContainerID> mSelectedContainerId;
26 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Inventory>> mInventory;
27 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStack>> mComplexItems;
28 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::HudContainerManagerModel>> mHudContainerManager;
29 // NOLINTEND
30
31public:
32 // virtual functions
33 // NOLINTBEGIN
34 virtual ~PlayerInventory() /*override*/;
35
36 virtual void containerSizeChanged(int) /*override*/;
37
38 virtual void containerContentChanged(int slot) /*override*/;
39
40 virtual void createTransactionContext(
41 ::std::function<void(::Container&, int, ::ItemStack const&, ::ItemStack const&)> callback,
42 ::std::function<void()> execute
43 );
44 // NOLINTEND
45
46public:
47 // member functions
48 // NOLINTBEGIN
49#ifdef LL_PLAT_C
50 MCAPI ::std::weak_ptr<::HudContainerManagerModel> _getHudContainerManagerModel() const;
51#endif
52
53 MCAPI bool add(::ItemStack& item, bool linkEmptySlot);
54
55 MCAPI void addListener(::ContainerContentChangeListener* listener);
56
57 MCAPI bool canAdd(::ItemStack const& item) const;
58
59 MCAPI int clearInventory(int resize);
60
61#ifdef LL_PLAT_C
62 MCAPI void clearInventoryWithDefault(bool isCreative);
63#endif
64
65 MCAPI void clearSlot(int slot, ::ContainerID containerId);
66
67 MCAPI void clearVanishEnchantedItemsOnDeath();
68
69#ifdef LL_PLAT_C
70 MCAPI bool dropSlot(int slot, bool onlyClearContainer, bool dropAll, ::ContainerID containerId, bool randomly);
71#endif
72
73 MCAPI int getContainerSize(::ContainerID containerId) const;
74
75 MCAPI int getFirstEmptySlot() const;
76
77 MCAPI int getHotbarSize() const;
78
79 MCAPI ::ItemStack const& getItem(int slot, ::ContainerID containerId) const;
80
81 MCAPI int getItemCount(::std::function<bool(::ItemStack const&)> comparator);
82
83 MCFOLD ::ContainerID getSelectedContainerId();
84
85 MCAPI ::ItemStack const& getSelectedItem() const;
86
87 MCAPI ::PlayerInventorySlotData getSelectedSlot() const;
88
89 MCAPI int getSlotWithItem(::ItemStack const& item, bool checkAux, bool checkData) const;
90
91 MCAPI ::std::vector<::ItemStack const*> getSlots() const;
92
93 MCAPI void removeItem(int slot, int count, ::ContainerID containerId);
94
95 MCAPI void removeListener(::ContainerContentChangeListener* listener);
96
97 MCAPI bool removeResource(int type);
98
99 MCAPI int removeResource(::ItemStack const& item, bool requireExactAux, bool requireExactData, int maxCount);
100
101 MCAPI bool selectSlot(int slot, ::ContainerID containerId);
102
103 MCAPI void serverInitItemStackId(int containerSlot);
104
105 MCAPI void
106 serverInitItemStackIds(int containerSlot, int count, ::std::function<void(int, ::ItemStack const&)> onNetIdChanged);
107
108 MCAPI void setContainerChanged(int slot);
109
110#ifdef LL_PLAT_C
111 MCAPI void setContainerSize(int size, ::ContainerID containerId);
112#endif
113
114 MCAPI void setItem(int slot, ::ItemStack const& item, ::ContainerID containerId, bool forceBalanced);
115
116 MCAPI void setSelectedItem(::ItemStack const& item);
117
118 MCAPI void setupDefaultInventory();
119
120 MCAPI void swapSlots(int from, int to);
121 // NOLINTEND
122
123public:
124 // destructor thunk
125 // NOLINTBEGIN
126 MCAPI void $dtor();
127 // NOLINTEND
128
129public:
130 // virtual function thunks
131 // NOLINTBEGIN
132 MCFOLD void $containerSizeChanged(int);
133
134 MCAPI void $containerContentChanged(int slot);
135
136 MCAPI void $createTransactionContext(
137 ::std::function<void(::Container&, int, ::ItemStack const&, ::ItemStack const&)> callback,
138 ::std::function<void()> execute
139 );
140
141
142 // NOLINTEND
143
144public:
145 // vftables
146 // NOLINTBEGIN
147 MCAPI static void** $vftableForContainerSizeChangeListener();
148
149 MCAPI static void** $vftableForContainerContentChangeListener();
150 // NOLINTEND
151};
Definition ContainerContentChangeListener.h:5
Definition ContainerSizeChangeListener.h:5
Definition Container.h:34
Definition HudContainerManagerModel.h:19
Definition Inventory.h:14
Definition ItemStack.h:35
Definition PlayerInventory.h:19
Definition PlayerInventorySlotData.h:8