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/script_core/lifetime_registry/scripting/StrongTypedObjectHandle.h"
7#include "mc/deps/script_core/lifetime_registry/scripting/WeakLifetimeScope.h"
8#include "mc/deps/script_core/lifetime_registry/scripting/WeakTypedObjectHandle.h"
9#include "mc/deps/script_core/runtime/scripting/Result.h"
10#include "mc/deps/script_core/runtime/scripting/Result_deprecated.h"
11#include "mc/world/item/ItemInstance.h"
12
13// auto generated forward declare list
14// clang-format off
15class ItemStackBase;
16class Vec3;
17namespace ScriptModuleMinecraft { class ScriptItemComponent; }
18namespace ScriptModuleMinecraft { class ScriptItemComponents; }
19namespace ScriptModuleMinecraft { class ScriptItemType; }
20namespace ScriptModuleMinecraft { struct ScriptRawMessageInterface; }
21namespace Scripting { struct ArgumentOutOfBoundsError; }
22namespace Scripting { struct ClassBinding; }
23namespace Scripting { struct ContextConfig; }
24namespace Scripting { struct UnsupportedAPIError; }
25namespace Scripting { struct Version; }
26// clang-format on
27
28namespace ScriptModuleMinecraft {
29
30class ScriptItemStack {
31public:
32 // member variables
33 // NOLINTBEGIN
34 ::ll::TypedStorage<8, 128, ::ItemInstance> mItemInstance;
35 ::ll::TypedStorage<8, 16, ::Scripting::WeakLifetimeScope> mScope;
36 ::ll::TypedStorage<8, 32, ::Scripting::WeakTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack>>
37 mScriptStack;
38 ::ll::TypedStorage<8, 32, ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>> mItemType;
39 ::ll::TypedStorage<
40 8,
41 64,
42 ::std::unordered_map<
43 ::std::string,
45 mAttachedComponents;
46 // NOLINTEND
47
48#ifdef LL_PLAT_S
49public:
50 // prevent constructor by default
51 ScriptItemStack();
52
53#else // LL_PLAT_C
54public:
55 // prevent constructor by default
56 ScriptItemStack(ScriptItemStack const&);
57 ScriptItemStack();
58
59#endif
60public:
61 // member functions
62 // NOLINTBEGIN
63#ifdef LL_PLAT_S
64 MCAPI ScriptItemStack(::ScriptModuleMinecraft::ScriptItemStack const&);
65#endif
66
67 MCAPI ScriptItemStack(
70 int amount,
71 int data
72 );
73
74 MCAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError>
75 _validateDynamicProperty(
76 ::std::string const& key,
77 ::std::variant<double, float, bool, ::std::string, ::Vec3> const& value
78 ) const;
79
80 MCAPI ::std::vector<::std::string> getCanDestroy() const;
81
82 MCAPI ::std::vector<::std::string> getCanPlaceOn() const;
83
84 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemComponent>>
85 getComponent(
86 ::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents> components,
87 ::std::string_view id,
88 bool includeCustom
89 );
90
91 MCAPI ::std::vector<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemComponent>>
92 getComponents(::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents> components, bool includeCustom);
93
94 MCAPI ::std::vector<::std::string> getLore() const;
95
96 MCAPI ::std::vector<::std::string> getTags() const;
97
98 MCAPI ::ScriptModuleMinecraft::ScriptItemStack& operator=(::ScriptModuleMinecraft::ScriptItemStack const&);
99
100 MCAPI void setAmountV010(int amount);
101
102 MCAPI ::Scripting::Result_deprecated<void>
103 setCanDestroy(::std::optional<::std::vector<::std::string>> const& blockIdentifiers);
104
105 MCAPI ::Scripting::Result_deprecated<void>
106 setCanPlaceOn(::std::optional<::std::vector<::std::string>> const& blockIdentifiers);
107
108 MCAPI void setData(int data);
109
110 MCAPI ::Scripting::Result<void, ::Scripting::ArgumentOutOfBoundsError, ::Scripting::UnsupportedAPIError>
111 setDynamicProperty(
112 ::Scripting::ContextConfig const& contextConfig,
113 ::std::string const& key,
114 ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>> const& optionalValue
115 );
116
117 MCAPI ~ScriptItemStack();
118 // NOLINTEND
119
120public:
121 // static functions
122 // NOLINTBEGIN
123 MCAPI static ::Scripting::ClassBinding bind(
124 ::std::shared_ptr<::ScriptModuleMinecraft::ScriptItemComponents>& itemComponents,
125 ::Scripting::Version const& version
126 );
127
128 MCAPI static ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack>
129 createHandle(::Scripting::WeakLifetimeScope scope, ::ItemStackBase const& item);
130
131 MCAPI static ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemStack>>
132 createOptionalHandle(::Scripting::WeakLifetimeScope scope, ::ItemStackBase const& item);
133
134 MCAPI static ::std::vector<::ScriptModuleMinecraft::ScriptRawMessageInterface>
135 createRawLoreVector(::std::vector<::std::string> lore);
136
137 MCAPI static ::std::optional<::std::vector<::std::string>> tryCreateLoreVector(
138 ::std::vector<::std::variant<::std::string, ::ScriptModuleMinecraft::ScriptRawMessageInterface>> const&
139 loreVariantList,
140 ::std::string& errorMessage
141 );
142
143 MCAPI static ::std::optional<::Scripting::ArgumentOutOfBoundsError>
144 validateLoreLength(::std::vector<::std::string> const& loreList);
145 // NOLINTEND
146
147public:
148 // constructor thunks
149 // NOLINTBEGIN
150#ifdef LL_PLAT_S
151 MCAPI void* $ctor(::ScriptModuleMinecraft::ScriptItemStack const&);
152#endif
153
154 MCAPI void* $ctor(
157 int amount,
158 int data
159 );
160 // NOLINTEND
161
162public:
163 // destructor thunk
164 // NOLINTBEGIN
165 MCAPI void $dtor();
166 // NOLINTEND
167};
168
169} // namespace ScriptModuleMinecraft
Definition ItemStackBase.h:44
Definition ScriptItemComponent.h:20
Definition ScriptItemComponents.h:24
Definition ScriptItemStack.h:30
Definition ScriptItemType.h:16
Definition StrongTypedObjectHandle.h:8
Definition WeakLifetimeScope.h:12
Definition Vec3.h:10
Definition ScriptRawMessageInterface.h:20
Definition ArgumentOutOfBoundsError.h:10
Definition ClassBinding.h:10
Definition ContextConfig.h:20
Definition UnsupportedAPIError.h:10
Definition Version.h:7