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/runtime/Result.h"
9#include "mc/deps/scripting/runtime/Result_deprecated.h"
10
11// auto generated forward declare list
12// clang-format off
13class BaseGameVersion;
14class ItemStackBase;
15class Vec3;
16namespace ScriptModuleMinecraft { class IScriptItemCustomComponentReader; }
17namespace ScriptModuleMinecraft { class ScriptItemComponent; }
18namespace ScriptModuleMinecraft { class ScriptItemComponents; }
19namespace ScriptModuleMinecraft { class ScriptItemType; }
20namespace ScriptModuleMinecraft { struct ScriptRawMessageInterface; }
21namespace Scripting { class WeakLifetimeScope; }
22namespace Scripting { struct ArgumentOutOfBoundsError; }
23namespace Scripting { struct ClassBinding; }
24namespace Scripting { struct ContextConfig; }
25namespace Scripting { struct EngineError; }
26namespace Scripting { struct Error; }
27namespace Scripting { struct UnsupportedAPIError; }
28namespace Scripting { struct Version; }
29// clang-format on
30
31namespace ScriptModuleMinecraft {
32
34public:
35 // member variables
36 // NOLINTBEGIN
42 // NOLINTEND
43
44public:
45 // prevent constructor by default
47
48public:
49 // member functions
50 // NOLINTBEGIN
52
54
57 ::ItemStackBase const& item,
59 );
60
64 int amount,
65 int data
66 );
67
68 MCNAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError>
70 ::std::string const& key,
71 ::std::variant<double, float, bool, ::std::string, ::Vec3> const& value
72 ) const;
73
74 MCNAPI void clearDynamicProperties(::Scripting::ContextConfig const& contextConfig);
75
76 MCNAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack>
78
79 MCNAPI ::std::vector<::std::string> getCanDestroy() const;
80
81 MCNAPI ::std::vector<::std::string> getCanPlaceOn() const;
82
83 MCNAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemComponent>>
85 ::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents> components,
86 ::std::string_view id,
87 bool includeCustom
88 );
89
90 MCNAPI ::std::vector<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemComponent>>
91 getComponents(::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents> components, bool includeCustom);
92
93 MCNAPI ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>>
94 getDynamicProperty(::Scripting::ContextConfig const& contextConfig, ::std::string const& key);
95
96 MCNAPI ::std::vector<::std::string> getDynamicPropertyIds(::Scripting::ContextConfig const& contextConfig);
97
99
100 MCNAPI ::Scripting::Result<::std::string, ::Scripting::EngineError> getLocalizationKey() const;
101
102 MCNAPI ::std::vector<::std::string> getLore() const;
103
104 MCNAPI ::std::optional<::std::string> getNameTag() const;
105
106 MCNAPI ::std::vector<::ScriptModuleMinecraft::ScriptRawMessageInterface> getRawLore() const;
107
108 MCNAPI ::std::vector<::std::string> getTags() const;
109
110 MCNAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType> getType() const;
111
112 MCNAPI ::std::string getTypeId() const;
113
114 MCNAPI bool hasComponent(
115 ::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents> components,
116 ::std::string_view id,
117 bool includeCustom
118 );
119
120 MCNAPI bool hasTag(::std::string const& tag) const;
121
123
124 MCNAPI bool matches(
125 ::std::string itemName,
126 ::std::optional<::std::unordered_map<::std::string, ::std::variant<int, ::std::string, bool>>> properties
127 ) const;
128
129 MCNAPI ::ScriptModuleMinecraft::ScriptItemStack& operator=(::ScriptModuleMinecraft::ScriptItemStack const&);
130
131 MCNAPI ::ScriptModuleMinecraft::ScriptItemStack& operator=(::ScriptModuleMinecraft::ScriptItemStack&&);
132
133 MCNAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError> setAmount(int amount);
134
135 MCNAPI ::Scripting::Result_deprecated<void>
136 setCanDestroy(::std::optional<::std::vector<::std::string>> const& blockIdentifiers);
137
138 MCNAPI ::Scripting::Result_deprecated<void>
139 setCanPlaceOn(::std::optional<::std::vector<::std::string>> const& blockIdentifiers);
140
141 MCNAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError>
143 ::Scripting::ContextConfig const& contextConfig,
144 ::std::unordered_map<
145 ::std::string,
146 ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>>> const& values
147 );
148
149 MCNAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError>
151 ::Scripting::ContextConfig const& contextConfig,
152 ::std::string const& key,
153 ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>> const& optionalValue
154 );
155
156 MCNAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::Error> setLore(
157 ::std::optional<
158 ::std::vector<::std::variant<::std::string, ::ScriptModuleMinecraft::ScriptRawMessageInterface>>> const&
159 loreVariantList
160 );
161
162 MCNAPI void setLoreV010(::std::optional<::std::vector<::std::string>> const& loreList);
163
164 MCNAPI ::Scripting::Result_deprecated<void> setNameTag(::std::optional<::std::string> nameTag);
165
166 MCNAPI void setNameTagV010(::std::optional<::std::string> nameTag);
167
169 // NOLINTEND
170
171public:
172 // static functions
173 // NOLINTBEGIN
174 MCNAPI static ::Scripting::ClassBinding bind(
175 ::BaseGameVersion const& baseGameVersion,
176 ::Scripting::Version const& version,
178 );
179
180 MCNAPI static ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack>
182
183 MCNAPI static ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack>>
185
186 MCNAPI static ::std::vector<::ScriptModuleMinecraft::ScriptRawMessageInterface>
187 createRawLoreVector(::std::vector<::std::string> lore);
188
189 MCNAPI static ::std::optional<::std::vector<::std::string>> tryCreateLoreVector(
190 ::std::vector<::std::variant<::std::string, ::ScriptModuleMinecraft::ScriptRawMessageInterface>> const&
191 loreVariantList,
192 ::std::string& errorMessage
193 );
194
195 MCNAPI static ::std::optional<::Scripting::ArgumentOutOfBoundsError>
196 validateLoreLength(::std::vector<::std::string> const& loreList);
197 // NOLINTEND
198
199public:
200 // constructor thunks
201 // NOLINTBEGIN
203
205
206 MCNAPI void* $ctor(
208 ::ItemStackBase const& item,
210 );
211
212 MCNAPI void* $ctor(
215 int amount,
216 int data
217 );
218 // NOLINTEND
219
220public:
221 // destructor thunk
222 // NOLINTBEGIN
223 MCNAPI void $dtor();
224 // NOLINTEND
225};
226
227} // namespace ScriptModuleMinecraft
Definition BaseGameVersion.h:8
Definition ItemStackBase.h:34
Definition ScriptItemStack.h:33
MCAPI bool matches(::std::string itemName, ::std::optional<::std::unordered_map<::std::string, ::std::variant< int, ::std::string, bool > > > properties) const
MCAPI ::Scripting::Result<::std::string, ::Scripting::EngineError > getLocalizationKey() const
static MCAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack > createHandle(::Scripting::WeakLifetimeScope scope, ::ItemStackBase const &item)
MCAPI ::Scripting::Result< void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError > _validateDynamicProperty(::std::string const &key, ::std::variant< double, float, bool, ::std::string, ::Vec3 > const &value) const
MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemComponent > > getComponent(::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents > components, ::std::string_view id, bool includeCustom)
MCAPI ::Scripting::Result< void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError > setDynamicProperty(::Scripting::ContextConfig const &contextConfig, ::std::string const &key, ::std::optional<::std::variant< double, float, bool, ::std::string, ::Vec3 > > const &optionalValue)
static MCAPI ::std::vector<::ScriptModuleMinecraft::ScriptRawMessageInterface > createRawLoreVector(::std::vector<::std::string > lore)
MCAPI ::Scripting::Result< void, ::Scripting::ArgumentOutOfBoundsError > setAmount(int amount)
MCAPI void setNameTagV010(::std::optional<::std::string > nameTag)
MCAPI bool isStackableWith(::ScriptModuleMinecraft::ScriptItemStack const &other) const
MCAPI ::std::vector<::std::string > getTags() const
static MCAPI ::Scripting::ClassBinding bind(::BaseGameVersion const &baseGameVersion, ::Scripting::Version const &version, ::WeakRef<::ScriptModuleMinecraft::IScriptItemCustomComponentReader const > itemCustomComponentRegistry)
MCAPI ScriptItemStack(::ScriptModuleMinecraft::ScriptItemStack &&)
MCAPI void setLoreV010(::std::optional<::std::vector<::std::string > > const &loreList)
MCAPI ::std::vector<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemComponent > > getComponents(::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents > components, bool includeCustom)
MCAPI ::std::vector<::std::string > getCanPlaceOn() const
MCAPI ScriptItemStack(::ScriptModuleMinecraft::ScriptItemStack const &)
static MCAPI ::std::optional<::std::vector<::std::string > > tryCreateLoreVector(::std::vector<::std::variant<::std::string, ::ScriptModuleMinecraft::ScriptRawMessageInterface > > const &loreVariantList, ::std::string &errorMessage)
MCAPI void * $ctor(::ScriptModuleMinecraft::ScriptItemStack &&)
MCAPI ::std::vector<::std::string > getLore() const
MCAPI void * $ctor(::ScriptModuleMinecraft::ScriptItemStack const &)
static MCAPI ::std::optional<::Scripting::ArgumentOutOfBoundsError > validateLoreLength(::std::vector<::std::string > const &loreList)
MCAPI ::Scripting::Result< void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError > setDynamicProperties(::Scripting::ContextConfig const &contextConfig, ::std::unordered_map< ::std::string, ::std::optional<::std::variant< double, float, bool, ::std::string, ::Vec3 > > > const &values)
MCAPI bool hasComponent(::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents > components, ::std::string_view id, bool includeCustom)
MCAPI void clearDynamicProperties(::Scripting::ContextConfig const &contextConfig)
MCAPI ::std::optional<::std::variant< double, float, bool, ::std::string, ::Vec3 > > getDynamicProperty(::Scripting::ContextConfig const &contextConfig, ::std::string const &key)
MCAPI ScriptItemStack(::Scripting::WeakLifetimeScope &scope, ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType > const &itemTypeHandle, int amount, int data)
static MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack > > createOptionalHandle(::Scripting::WeakLifetimeScope scope, ::ItemStackBase const &item)
MCAPI ::Scripting::Result_deprecated< void > setCanPlaceOn(::std::optional<::std::vector<::std::string > > const &blockIdentifiers)
MCAPI void * $ctor(::Scripting::WeakLifetimeScope &scope, ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType > const &itemTypeHandle, int amount, int data)
MCAPI ::Scripting::Result_deprecated< void > setCanDestroy(::std::optional<::std::vector<::std::string > > const &blockIdentifiers)
MCAPI ::std::vector<::ScriptModuleMinecraft::ScriptRawMessageInterface > getRawLore() const
MCAPI ::std::vector<::std::string > getCanDestroy() const
MCAPI bool hasTag(::std::string const &tag) const
MCAPI ScriptItemStack(::Scripting::WeakLifetimeScope &scope, ::ItemStackBase const &item, ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType > const &itemTypeHandle)
MCAPI int getDynamicPropertyTotalByteCount(::Scripting::ContextConfig const &contextConfig)
MCAPI::ScriptModuleMinecraft::ScriptItemStack & operator=(::ScriptModuleMinecraft::ScriptItemStack &&)
MCAPI::std::string getTypeId() const
MCAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType > getType() const
MCAPI ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack > clone(::Scripting::WeakLifetimeScope scope) const
MCAPI ::std::vector<::std::string > getDynamicPropertyIds(::Scripting::ContextConfig const &contextConfig)
MCAPI::ScriptModuleMinecraft::ScriptItemStack & operator=(::ScriptModuleMinecraft::ScriptItemStack const &)
MCAPI ::Scripting::Result< void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::Error > setLore(::std::optional< ::std::vector<::std::variant<::std::string, ::ScriptModuleMinecraft::ScriptRawMessageInterface > > > const &loreVariantList)
MCAPI ::std::optional<::std::string > getNameTag() const
MCAPI void * $ctor(::Scripting::WeakLifetimeScope &scope, ::ItemStackBase const &item, ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType > const &itemTypeHandle)
MCAPI ::Scripting::Result_deprecated< void > setNameTag(::std::optional<::std::string > nameTag)
Definition StrongTypedObjectHandle.h:8
Definition WeakLifetimeScope.h:7
Definition Vec3.h:10
Definition WeakRef.h:8
Definition ContextConfig.h:20
Definition Version.h:7
Definition Alias.h:14