LeviLamina
Loading...
Searching...
No Matches
ScriptItemStack.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/game_refs/WeakRef.h"
7#include "mc/deps/scripting/lifetime_registry/StrongTypedObjectHandle.h"
8#include "mc/deps/scripting/lifetime_registry/WeakLifetimeScope.h"
9#include "mc/deps/scripting/lifetime_registry/WeakTypedObjectHandle.h"
10#include "mc/deps/scripting/runtime/Result.h"
11#include "mc/deps/scripting/runtime/Result_deprecated.h"
12#include "mc/world/item/ItemInstance.h"
13
14// auto generated forward declare list
15// clang-format off
16class BaseGameVersion;
17class ItemStackBase;
18class Vec3;
19namespace ScriptModuleMinecraft { class IScriptItemCustomComponentReader; }
20namespace ScriptModuleMinecraft { class ScriptItemComponent; }
21namespace ScriptModuleMinecraft { class ScriptItemComponents; }
22namespace ScriptModuleMinecraft { class ScriptItemType; }
23namespace ScriptModuleMinecraft { struct ScriptRawMessageInterface; }
24namespace Scripting { struct ArgumentOutOfBoundsError; }
25namespace Scripting { struct ClassBinding; }
26namespace Scripting { struct ContextConfig; }
27namespace Scripting { struct EngineError; }
28namespace Scripting { struct Error; }
29namespace Scripting { struct UnsupportedAPIError; }
30namespace Scripting { struct Version; }
31// clang-format on
32
33namespace ScriptModuleMinecraft {
34
35class ScriptItemStack {
36public:
37 // member variables
38 // NOLINTBEGIN
39 ::ll::TypedStorage<8, 128, ::ItemInstance> mItemInstance;
40 ::ll::TypedStorage<8, 16, ::Scripting::WeakLifetimeScope> mScope;
41 ::ll::TypedStorage<8, 32, ::Scripting::WeakTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack>>
42 mScriptStack;
43 ::ll::TypedStorage<8, 32, ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>> mItemType;
44 ::ll::TypedStorage<
45 8,
46 64,
47 ::std::unordered_map<
48 ::std::string,
50 mAttachedComponents;
51 // NOLINTEND
52
53public:
54 // prevent constructor by default
55 ScriptItemStack();
56
57public:
58 // member functions
59 // NOLINTBEGIN
60 MCAPI ScriptItemStack(::ScriptModuleMinecraft::ScriptItemStack&&);
61
62 MCAPI ScriptItemStack(::ScriptModuleMinecraft::ScriptItemStack const&);
63
64 MCAPI ScriptItemStack(
66 ::ItemStackBase const& item,
68 );
69
70 MCAPI ScriptItemStack(
73 int amount,
74 int data
75 );
76
77 MCAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError>
78 _validateDynamicProperty(
79 ::std::string const& key,
80 ::std::variant<double, float, bool, ::std::string, ::Vec3> const& value
81 ) const;
82
83 MCAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack>
84 clone(::Scripting::WeakLifetimeScope scope) const;
85
86 MCAPI ::std::vector<::std::string> getCanDestroy() const;
87
88 MCAPI ::std::vector<::std::string> getCanPlaceOn() const;
89
90 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemComponent>>
91 getComponent(
92 ::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents> components,
93 ::std::string_view id,
94 bool includeCustom
95 );
96
97 MCAPI ::std::vector<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemComponent>>
98 getComponents(::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents> components, bool includeCustom);
99
100 MCAPI ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>>
101 getDynamicProperty(::Scripting::ContextConfig const& contextConfig, ::std::string const& key);
102
103 MCAPI ::std::vector<::std::string> getDynamicPropertyIds(::Scripting::ContextConfig const& contextConfig);
104
105 MCAPI int getDynamicPropertyTotalByteCount(::Scripting::ContextConfig const& contextConfig);
106
107 MCAPI ::Scripting::Result<::std::string, ::Scripting::EngineError> getLocalizationKey() const;
108
109 MCAPI ::std::vector<::std::string> getLore() const;
110
111 MCAPI ::std::optional<::std::string> getNameTag() const;
112
113 MCAPI ::std::vector<::ScriptModuleMinecraft::ScriptRawMessageInterface> getRawLore() const;
114
115 MCAPI ::std::vector<::std::string> getTags() const;
116
117 MCAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType> getType() const;
118
119 MCAPI ::std::string getTypeId() const;
120
121 MCAPI bool hasComponent(
122 ::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents> components,
123 ::std::string_view id,
124 bool includeCustom
125 );
126
127 MCAPI bool hasTag(::std::string const& tag) const;
128
129 MCAPI bool matches(
130 ::std::string itemName,
131 ::std::optional<::std::unordered_map<::std::string, ::std::variant<int, ::std::string, bool>>> properties
132 ) const;
133
134 MCAPI ::ScriptModuleMinecraft::ScriptItemStack& operator=(::ScriptModuleMinecraft::ScriptItemStack&&);
135
136 MCAPI ::ScriptModuleMinecraft::ScriptItemStack& operator=(::ScriptModuleMinecraft::ScriptItemStack const&);
137
138 MCAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError> setAmount(int amount);
139
140 MCAPI ::Scripting::Result_deprecated<void>
141 setCanDestroy(::std::optional<::std::vector<::std::string>> const& blockIdentifiers);
142
143 MCAPI ::Scripting::Result_deprecated<void>
144 setCanPlaceOn(::std::optional<::std::vector<::std::string>> const& blockIdentifiers);
145
146 MCAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError>
147 setDynamicProperties(
148 ::Scripting::ContextConfig const& contextConfig,
149 ::std::unordered_map<
150 ::std::string,
151 ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>>> const& values
152 );
153
154 MCAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError>
155 setDynamicProperty(
156 ::Scripting::ContextConfig const& contextConfig,
157 ::std::string const& key,
158 ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>> const& optionalValue
159 );
160
161 MCAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::Error> setLore(
162 ::std::optional<
163 ::std::vector<::std::variant<::std::string, ::ScriptModuleMinecraft::ScriptRawMessageInterface>>> const&
164 loreVariantList
165 );
166
167 MCAPI ::Scripting::Result_deprecated<void> setNameTag(::std::optional<::std::string> nameTag);
168
169 MCAPI void setNameTagV010(::std::optional<::std::string> nameTag);
170
171 MCAPI ~ScriptItemStack();
172 // NOLINTEND
173
174public:
175 // static functions
176 // NOLINTBEGIN
177 MCAPI static ::Scripting::ClassBinding bind(
178 ::BaseGameVersion const& baseGameVersion,
179 ::Scripting::Version const& version,
181 );
182
183 MCAPI static ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack>
184 createHandle(::Scripting::WeakLifetimeScope scope, ::ItemStackBase const& item);
185
186 MCAPI static ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack>>
187 createOptionalHandle(::Scripting::WeakLifetimeScope scope, ::ItemStackBase const& item);
188
189 MCAPI static ::std::vector<::ScriptModuleMinecraft::ScriptRawMessageInterface>
190 createRawLoreVector(::std::vector<::std::string> lore);
191
192 MCAPI static ::std::optional<::std::vector<::std::string>> tryCreateLoreVector(
193 ::std::vector<::std::variant<::std::string, ::ScriptModuleMinecraft::ScriptRawMessageInterface>> const&
194 loreVariantList,
195 ::std::string& errorMessage
196 );
197
198 MCAPI static ::std::optional<::Scripting::ArgumentOutOfBoundsError>
199 validateLoreLength(::std::vector<::std::string> const& loreList);
200 // NOLINTEND
201
202public:
203 // constructor thunks
204 // NOLINTBEGIN
205 MCAPI void* $ctor(::ScriptModuleMinecraft::ScriptItemStack&&);
206
207 MCAPI void* $ctor(::ScriptModuleMinecraft::ScriptItemStack const&);
208
209 MCAPI void* $ctor(
211 ::ItemStackBase const& item,
213 );
214
215 MCAPI void* $ctor(
218 int amount,
219 int data
220 );
221 // NOLINTEND
222
223public:
224 // destructor thunk
225 // NOLINTBEGIN
226 MCAPI void $dtor();
227 // NOLINTEND
228};
229
230} // namespace ScriptModuleMinecraft
Definition BaseGameVersion.h:8
Definition ItemStackBase.h:44
Definition IScriptItemCustomComponentReader.h:18
Definition ScriptItemComponent.h:20
Definition ScriptItemComponents.h:25
Definition ScriptItemStack.h:35
Definition ScriptItemType.h:16
Definition StrongTypedObjectHandle.h:8
Definition WeakLifetimeScope.h:7
Definition Vec3.h:10
Definition WeakRef.h:8
Definition ScriptRawMessageInterface.h:20
Definition ArgumentOutOfBoundsError.h:15
Definition ClassBinding.h:19
Definition ContextConfig.h:20
Definition EngineError.h:15
Definition Error.h:10
Definition UnsupportedAPIError.h:15
Definition Version.h:7