Skip to content
LeviMC
English
AutoLightDark
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/item/HandSlot.h"
8#include "mc/world/item/ItemStackBase.h"
9
10// auto generated forward declare list
11// clang-format off
12class Actor;
13class Block;
14class BlockPalette;
15class BlockPos;
16class CompoundTag;
17class ILevel;
19class Item;
21class Vec3;
22struct Brightness;
24// clang-format on
25
26class ItemStack : public ::ItemStackBase {
27public:
28 // member variables
29 // NOLINTBEGIN
30 ::ll::TypedStorage<8, 24, ::ItemStackNetIdVariant> mNetIdVariant;
31 // NOLINTEND
32
33#ifdef LL_PLAT_S
34#else // LL_PLAT_C
35public:
36 ItemStack() = default;
37
38#endif
39public:
40 // virtual functions
41 // NOLINTBEGIN
42 virtual void reinit(::Block const& block, int count) /*override*/;
43
44 virtual void reinit(::Item const& item, int count, int auxValue) /*override*/;
45
46 virtual void reinit(::std::string_view const name, int count, int auxValue) /*override*/;
47
48 virtual void setNull(::std::optional<::std::string> reason) /*override*/;
49
50 virtual ::std::string toString() const /*override*/;
51
52 virtual ::std::string toDebugString() const /*override*/;
53
54 virtual ~ItemStack() /*override*/;
55 // NOLINTEND
56
57public:
58 // member functions
59 // NOLINTBEGIN
60#ifdef LL_PLAT_S
61 MCAPI ItemStack();
62#endif
63
64 MCAPI ItemStack(::ItemStack const& rhs);
65
66 MCAPI ::ItemStack clone() const;
67
68#ifdef LL_PLAT_C
69 MCNAPI float getDestroySpeed(::Block const& block) const;
70
71 MCNAPI ::Brightness getLightEmission() const;
72#endif
73
74 MCNAPI ::ItemStack getStrippedNetworkItem() const;
75
76 MCAPI bool matchesNetIdVariant(::ItemStack const& other) const;
77
78 MCAPI ::ItemStack& operator=(::ItemStack const& rhs);
79
80 MCAPI bool sameItemAndAuxAndBlockData(::ItemStack const& otherItemStack) const;
81
82 MCAPI void serverInitNetId();
83
84 MCAPI void useAsFuel();
85
86 MCAPI ::InteractionResult useOn(
87 ::Actor& entity,
88 ::BlockPos const& pos,
89 uchar face,
90 ::HandSlot handSlot,
91 ::Vec3 const& clickPos,
92 ::ItemUsedOnEventContext itemUsedOnEventContext
93 );
94 // NOLINTEND
95
96public:
97 // static functions
98 // NOLINTBEGIN
99#ifdef LL_PLAT_C
100 MCNAPI static ::ItemStack
101 fromDescriptor(::NetworkItemStackDescriptor const& descriptor, ::BlockPalette& blockPalette, bool isClientSide);
102#endif
103
104 MCAPI static ::ItemStack fromTag(::CompoundTag const& tag);
105
106 MCAPI static ::ItemStack fromTag(::CompoundTag const& tag, ::ILevel& level);
107 // NOLINTEND
108
109public:
110 // static variables
111 // NOLINTBEGIN
112 MCAPI static ::ItemStack const& EMPTY_ITEM();
113 // NOLINTEND
114
115public:
116 // constructor thunks
117 // NOLINTBEGIN
118#ifdef LL_PLAT_S
119 MCAPI void* $ctor();
120#endif
121
122 MCAPI void* $ctor(::ItemStack const& rhs);
123 // NOLINTEND
124
125public:
126 // destructor thunk
127 // NOLINTBEGIN
128 MCFOLD void $dtor();
129 // NOLINTEND
130
131public:
132 // virtual function thunks
133 // NOLINTBEGIN
134 MCAPI void $reinit(::Block const& block, int count);
135
136 MCAPI void $reinit(::Item const& item, int count, int auxValue);
137
138 MCAPI void $reinit(::std::string_view const name, int count, int auxValue);
139
140 MCAPI void $setNull(::std::optional<::std::string> reason);
141
142 MCAPI ::std::string $toString() const;
143
144 MCAPI ::std::string $toDebugString() const;
145
146
147 // NOLINTEND
148
149public:
150 // vftables
151 // NOLINTBEGIN
152 MCNAPI static void** $vftable();
153 // NOLINTEND
154};
Definition Actor.h:116
Definition BlockPalette.h:18
Definition BlockPos.h:14
Definition Block.h:42
Definition CompoundTag.h:18
Definition ILevel.h:223
Definition InteractionResult.h:5
MCAPI::ItemStack getStrippedNetworkItem() const
static MCAPI void ** $vftable()
Definition Item.h:73
Definition NetworkItemStackDescriptor.h:17
Definition Vec3.h:10
Definition Brightness.h:8
Definition ItemUsedOnEventContext.h:8