LeviLamina
Loading...
Searching...
No Matches
ItemStack.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/inventory/network/ItemStackNetIdVariant.h"
7#include "mc/world/inventory/network/TypedClientNetId.h"
8#include "mc/world/inventory/network/TypedServerNetId.h"
9#include "mc/world/item/ItemStackBase.h"
10#include "mc/world/item/ItemUseMethod.h"
11
12// auto generated forward declare list
13// clang-format off
14class Actor;
15class Block;
16class BlockPalette;
17class CompoundTag;
18class ILevel;
20class Item;
21class ItemInstance;
22class Level;
23class Mob;
25class Player;
27class Vec3;
28struct Brightness;
33// clang-format on
34
35class ItemStack : public ::ItemStackBase {
36public:
37 // member variables
38 // NOLINTBEGIN
39 ::ll::TypedStorage<8, 24, ::ItemStackNetIdVariant> mNetIdVariant;
40 // NOLINTEND
41
42public:
43 // virtual functions
44 // NOLINTBEGIN
45 virtual void reinit(::Block const& block, int count) /*override*/;
46
47 virtual void reinit(::Item const& item, int count, int auxValue) /*override*/;
48
49 virtual void reinit(::std::string_view const name, int count, int auxValue) /*override*/;
50
51 virtual void setNull(::std::optional<::std::string> reason) /*override*/;
52
53 virtual ::std::string toString() const /*override*/;
54
55 virtual ::std::string toDebugString() const /*override*/;
56 // NOLINTEND
57
58public:
59 // member functions
60 // NOLINTBEGIN
61 MCAPI ItemStack();
62
63 MCAPI explicit ItemStack(::RecipeIngredient const& ingredient);
64
65 MCAPI ItemStack(::ItemStack const& rhs);
66
67 MCAPI explicit ItemStack(::ItemInstance const& rhs);
68
69 MCAPI ItemStack(::Block const& block, int count, ::CompoundTag const* _userData);
70
71 MCAPI ItemStack(::Item const& item, int count = 1, int auxValue = 0, ::CompoundTag const* _userData = nullptr);
72
73 MCAPI ItemStack(::std::string_view name, int count, int auxValue, ::CompoundTag const* _userData);
74
75 MCAPI void _assignNetIdVariant(::ItemStack const& fromItem) const;
76
77#ifdef LL_PLAT_C
78 MCAPI bool canUseAsAttack() const;
79#endif
80
81 MCAPI void clientInitLegacyRequestId(::ItemStackLegacyRequestId const& legacyClientRequestId);
82
83#ifdef LL_PLAT_C
84 MCAPI void clientInitNetId(::ItemStackNetId const& serverNetId);
85
86 MCAPI void clientInitRequestId(::ItemStackRequestId const& clientRequestId);
87#endif
88
89 MCAPI ::ItemStack clone() const;
90
91 MCAPI float getDestroySpeed(::Block const& block) const;
92
93 MCFOLD ::ItemStackNetIdVariant const& getItemStackNetIdVariant() const;
94
95#ifdef LL_PLAT_C
96 MCAPI ::Brightness getLightEmission() const;
97#endif
98
99 MCAPI int getMaxUseDuration() const;
100
101 MCAPI ::ItemStack getStrippedNetworkItem() const;
102
103 MCAPI bool hasItemStackNetId() const;
104
105 MCAPI bool inventoryTick(::Level& level, ::Actor& owner, int slot, bool selected);
106
107#ifdef LL_PLAT_C
108 MCAPI bool isBundle() const;
109#endif
110
111 MCAPI bool matchesAndNetIdVariantMatches(::ItemStack const& other) const;
112
113 MCAPI bool matchesNetIdVariant(::ItemStack const& other) const;
114
115 MCAPI ::ItemStack& operator=(::ItemStack const& rhs);
116
117 MCAPI void playSoundIncrementally(::Mob& mob) const;
118
119 MCAPI void releaseUsing(::Player* player, int durationLeft);
120
121 MCAPI bool sameItemAndAuxAndBlockData(::ItemStack const& otherItemStack) const;
122
123 MCAPI void serverInitNetId();
124
125 MCAPI ::ItemStackNetId const* tryGetItemStackNetId() const;
126
127#ifdef LL_PLAT_C
128 MCAPI ::ItemStackRequestId const* tryGetItemStackRequestId() const;
129#endif
130
131 MCAPI ::ItemStack& use(::Player& player);
132
133 MCAPI ::ItemStack& useAsAttack(::Player& player, ::Vec3 const& aimDirection);
134
135 MCAPI void useAsFuel();
136
137 MCAPI ::InteractionResult useOn(
138 ::Actor& entity,
139 int x,
140 int y,
141 int z,
142 uchar face,
143 ::Vec3 const& clickPos,
144 ::ItemUsedOnEventContext itemUsedOnEventContext
145 );
146
147 MCAPI ::ItemUseMethod useTimeDepleted(::Level* level, ::Player* player);
148 // NOLINTEND
149
150public:
151 // static functions
152 // NOLINTBEGIN
153 MCAPI static ::ItemStack
154 fromDescriptor(::NetworkItemStackDescriptor const& descriptor, ::BlockPalette& blockPalette, bool isClientSide);
155
156 MCAPI static ::ItemStack fromTag(::CompoundTag const& tag);
157
158 MCAPI static ::ItemStack fromTag(::CompoundTag const& tag, ::ILevel& level);
159 // NOLINTEND
160
161public:
162 // static variables
163 // NOLINTBEGIN
164 MCAPI static ::ItemStack const& EMPTY_ITEM();
165 // NOLINTEND
166
167public:
168 // constructor thunks
169 // NOLINTBEGIN
170 MCAPI void* $ctor();
171
172 MCAPI void* $ctor(::RecipeIngredient const& ingredient);
173
174 MCAPI void* $ctor(::ItemStack const& rhs);
175
176 MCAPI void* $ctor(::ItemInstance const& rhs);
177
178 MCAPI void* $ctor(::Block const& block, int count, ::CompoundTag const* _userData);
179
180 MCAPI void* $ctor(::Item const& item, int count, int auxValue, ::CompoundTag const* _userData);
181
182 MCAPI void* $ctor(::std::string_view name, int count, int auxValue, ::CompoundTag const* _userData);
183 // NOLINTEND
184
185public:
186 // virtual function thunks
187 // NOLINTBEGIN
188 MCAPI void $reinit(::Block const& block, int count);
189
190 MCAPI void $reinit(::Item const& item, int count, int auxValue);
191
192 MCAPI void $reinit(::std::string_view const name, int count, int auxValue);
193
194 MCAPI void $setNull(::std::optional<::std::string> reason);
195
196 MCAPI ::std::string $toString() const;
197
198 MCAPI ::std::string $toDebugString() const;
199
200
201 // NOLINTEND
202
203public:
204 // vftables
205 // NOLINTBEGIN
206 MCAPI static void** $vftable();
207 // NOLINTEND
208};
Definition Actor.h:123
Definition BlockPalette.h:21
Definition Block.h:69
Definition CompoundTag.h:23
Definition ILevel.h:218
Definition InteractionResult.h:5
Definition ItemInstance.h:15
Definition Item.h:71
Definition Level.h:254
Definition Mob.h:56
Definition NetworkItemStackDescriptor.h:21
Definition Player.h:136
Definition RecipeIngredient.h:16
Definition Vec3.h:10
Definition Brightness.h:8
Definition ItemStackLegacyRequestIdTag.h:5
Definition ItemStackNetIdTag.h:5
Definition ItemStackRequestIdTag.h:5
Definition ItemUsedOnEventContext.h:8