LeviLamina
Loading...
Searching...
No Matches
ItemDescriptor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/WeakPtr.h"
7#include "mc/molang/MolangVersion.h"
8
9// auto generated forward declare list
10// clang-format off
11class BinaryStream;
12class Block;
13class BlockLegacy;
14class CompoundTag;
15class Item;
17struct ItemTag;
18namespace Json { class Value; }
19namespace SharedTypes::Legacy { struct ItemDescriptor; }
20// clang-format on
21
23public:
24 // ItemDescriptor inner types declare
25 // clang-format off
26 struct BaseDescriptor;
27 struct ItemEntry;
28 // clang-format on
29
30 // ItemDescriptor inner types define
31 struct ItemEntry {
32 public:
33 // member variables
34 // NOLINTBEGIN
35 ::ll::TypedStorage<8, 8, ::Item const*> mItem;
36 ::ll::TypedStorage<2, 2, short> mAuxValue;
37 // NOLINTEND
38
39 public:
40 // member functions
41 // NOLINTBEGIN
42 MCAPI ::Block const* getBlock() const;
43 // NOLINTEND
44 };
45
46 enum class InternalType : uchar {
47 Invalid = 0,
48 Default = 1,
49 Molang = 2,
50 ItemTag = 3,
51 Deferred = 4,
52 ComplexAlias = 5,
53 };
54
56 public:
57 // virtual functions
58 // NOLINTBEGIN
59 // vIndex: 0
60 virtual ::std::unique_ptr<::ItemDescriptor::BaseDescriptor> clone() const = 0;
61
62 // vIndex: 1
63 virtual bool sameItems(::ItemDescriptor::BaseDescriptor const& otherDescriptor, bool compareAux) const;
64
65 // vIndex: 2
66 virtual bool sameItem(::ItemDescriptor::ItemEntry const&, bool) const = 0;
67
68 // vIndex: 3
69 virtual ::std::string const& getFullName() const;
70
71 // vIndex: 4
72 virtual ::std::string toString() const;
73
74 // vIndex: 5
75 virtual ::ItemDescriptor::ItemEntry getItem() const;
76
77 // vIndex: 6
78 virtual bool forEachItemUntil(::std::function<bool(::Item const&, short)> func) const;
79
80 // vIndex: 7
81 virtual ::std::map<::std::string, ::std::string> toMap() const = 0;
82
83 // vIndex: 8
84 virtual ::std::optional<::CompoundTag> save() const = 0;
85
86 // vIndex: 10
87 virtual void serialize(::Json::Value& val) const;
88
89 // vIndex: 9
90 virtual void serialize(::BinaryStream&) const = 0;
91
92 // vIndex: 11
93 virtual ::ItemDescriptor::InternalType getType() const = 0;
94
95 // vIndex: 12
96 virtual bool isValid() const;
97
98 // vIndex: 13
99 virtual uint64 getHash() const = 0;
100
101 // vIndex: 14
102 virtual bool shouldResolve() const;
103
104 // vIndex: 15
105 virtual ::std::unique_ptr<::ItemDescriptor::BaseDescriptor> resolve() const;
106
107 // vIndex: 16
108 virtual ~BaseDescriptor();
109 // NOLINTEND
110
111 public:
112 // destructor thunk
113 // NOLINTBEGIN
114 MCAPI void $dtor();
115 // NOLINTEND
116
117 public:
118 // virtual function thunks
119 // NOLINTBEGIN
120 MCAPI bool $sameItems(::ItemDescriptor::BaseDescriptor const& otherDescriptor, bool compareAux) const;
121
122 MCFOLD ::std::string const& $getFullName() const;
123
124 MCAPI ::std::string $toString() const;
125
126 MCFOLD ::ItemDescriptor::ItemEntry $getItem() const;
127
128 MCAPI bool $forEachItemUntil(::std::function<bool(::Item const&, short)> func) const;
129
130 MCAPI void $serialize(::Json::Value& val) const;
131
132 MCFOLD bool $isValid() const;
133
134 MCFOLD bool $shouldResolve() const;
135
136 MCFOLD ::std::unique_ptr<::ItemDescriptor::BaseDescriptor> $resolve() const;
137 // NOLINTEND
138
139 public:
140 // vftables
141 // NOLINTBEGIN
142 MCAPI static void** $vftable();
143 // NOLINTEND
144 };
145
146public:
147 // member variables
148 // NOLINTBEGIN
149 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemDescriptor::BaseDescriptor>> mImpl;
150 // NOLINTEND
151
152public:
153 // prevent constructor by default
155
156public:
157 // virtual functions
158 // NOLINTBEGIN
159 // vIndex: 0
160 virtual ~ItemDescriptor();
161
162 // vIndex: 2
163 virtual void serialize(::Json::Value& val) const;
164
165 // vIndex: 1
166 virtual void serialize(::BinaryStream& stream) const;
167 // NOLINTEND
168
169public:
170 // member functions
171 // NOLINTBEGIN
172 MCAPI explicit ItemDescriptor(::Block const& block);
173
174 MCAPI explicit ItemDescriptor(::BlockLegacy const& block);
175
176 MCAPI explicit ItemDescriptor(::ItemTag const& itemTag);
177
178 MCAPI explicit ItemDescriptor(::ReadOnlyBinaryStream& stream);
179
180 MCAPI ItemDescriptor(::std::string_view fullName, int itemAux);
181
182 MCAPI ItemDescriptor(::Item const& item, int auxValue);
183
184 MCAPI ItemDescriptor(::Json::Value const& val, ::MolangVersion molangVersion);
185
186 MCAPI void _resolve() const;
187
188 MCAPI bool forEachItemUntil(::std::function<bool(::Item const&, short)> func) const;
189
190 MCAPI short getAuxValue() const;
191
192 MCAPI ::Block const* getBlock() const;
193
194 MCAPI short getId() const;
195
196 MCAPI int getIdAux() const;
197
198 MCAPI ::Item const* getItem() const;
199
200 MCAPI ::WeakPtr<::BlockLegacy const> const& getLegacyBlock() const;
201
202 MCAPI ::std::string getRawNameId() const;
203
204 MCAPI ::std::string getSerializedNameAndAux() const;
205
206 MCAPI bool isNull() const;
207
208 MCAPI bool isValid(bool shouldResolve) const;
209
210 MCAPI void operator=(::ItemDescriptor const& rhs);
211
212 MCAPI void operator=(::ItemDescriptor&& rhs);
213
214 MCAPI bool sameItem(::ItemDescriptor const& otherItemDescriptor, bool compareAux) const;
215
216 MCAPI ::std::optional<::CompoundTag> save() const;
217 // NOLINTEND
218
219public:
220 // static functions
221 // NOLINTBEGIN
222 MCAPI static ::std::optional<::ItemDescriptor> fromTag(::CompoundTag const* tag);
223
224 MCAPI static ::SharedTypes::Legacy::ItemDescriptor toSharedTypes(::ItemDescriptor const& id);
225 // NOLINTEND
226
227public:
228 // constructor thunks
229 // NOLINTBEGIN
230 MCAPI void* $ctor(::Block const& block);
231
232 MCAPI void* $ctor(::BlockLegacy const& block);
233
234 MCAPI void* $ctor(::ItemTag const& itemTag);
235
236 MCAPI void* $ctor(::ReadOnlyBinaryStream& stream);
237
238 MCAPI void* $ctor(::std::string_view fullName, int itemAux);
239
240 MCAPI void* $ctor(::Item const& item, int auxValue);
241
242 MCAPI void* $ctor(::Json::Value const& val, ::MolangVersion molangVersion);
243 // NOLINTEND
244
245public:
246 // destructor thunk
247 // NOLINTBEGIN
248 MCFOLD void $dtor();
249 // NOLINTEND
250
251public:
252 // virtual function thunks
253 // NOLINTBEGIN
254 MCAPI void $serialize(::Json::Value& val) const;
255
256 MCAPI void $serialize(::BinaryStream& stream) const;
257 // NOLINTEND
258
259public:
260 // vftables
261 // NOLINTBEGIN
262 MCAPI static void** $vftable();
263 // NOLINTEND
264};
Definition BinaryStream.h:10
Definition BlockLegacy.h:88
Definition Block.h:36
Definition CompoundTag.h:13
Definition ItemDescriptor.h:22
Definition Item.h:65
Definition Value.h:16
Definition ReadOnlyBinaryStream.h:8
Definition ItemDescriptor.h:55
Definition ItemDescriptor.h:31
Definition ItemTag.h:8
Definition serialize.h:11