LeviLamina
Loading...
Searching...
No Matches
ScriptItems.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/scripting/lifetime_registry/StrongTypedObjectHandle.h"
7#include "mc/world/item/registry/ItemRegistryRef.h"
8
9// auto generated forward declare list
10// clang-format off
11class HashedString;
12namespace ScriptModuleMinecraft { class ScriptItemType; }
13namespace Scripting { class ModuleBindingBuilder; }
14namespace Scripting { class WeakLifetimeScope; }
15// clang-format on
16
17namespace ScriptModuleMinecraft {
18
19class ScriptItems {
20public:
21 // ScriptItems inner types define
22 using ItemTypesMap = ::std::
23 unordered_map<::std::string, ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>;
24
25public:
26 // member variables
27 // NOLINTBEGIN
28 ::ll::TypedStorage<8, 16, ::ItemRegistryRef const> mItemRegistry;
29 ::ll::TypedStorage<
30 8,
31 64,
32 ::std::
33 unordered_map<::std::string, ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>>
34 mItems;
35 ::ll::TypedStorage<
36 8,
37 64,
38 ::std::
39 unordered_map<::std::string, ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>>
40 mItemAliases;
41 ::ll::TypedStorage<
42 8,
43 64,
44 ::std::
45 unordered_map<::std::string, ::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>>
46 mThirdPartyItems;
47 ::ll::TypedStorage<1, 1, bool> mRegisteredItems;
48 // NOLINTEND
49
50public:
51 // prevent constructor by default
52 ScriptItems();
53
54public:
55 // member functions
56 // NOLINTBEGIN
57 MCAPI explicit ScriptItems(::ItemRegistryRef itemRegistry);
58
59 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
60 _getItemHandleForAlias(::HashedString const& aliasName) const;
61
62 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
63 _registerItemType(
64 ::std::unordered_map<
65 ::std::string,
68 ::std::string itemName,
69 bool allowAirBlockItem
70 );
71
72 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
73 _registerItemTypeAlias(
74 ::std::string itemName,
76 );
77
78 MCAPI void _registerItems(::Scripting::WeakLifetimeScope& scope, bool allowAirBlockItem);
79
80 MCAPI void _tryRegisterItemTypeAlias(::HashedString const& aliasName);
81
82 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
83 get(::Scripting::WeakLifetimeScope& scope, ::std::string const& itemName, bool allowAirBlockItem);
84
85 MCAPI ::std::vector<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
86 getAll(::Scripting::WeakLifetimeScope& scope, bool allowAirBlockItem);
87
88 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
89 getOrAdd(::Scripting::WeakLifetimeScope& scope, ::std::string const& itemName, bool allowAirBlockItem);
90
91 MCAPI ~ScriptItems();
92 // NOLINTEND
93
94public:
95 // static functions
96 // NOLINTBEGIN
97 MCAPI static ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
98 _getOrCreateItemTypeHandle(::Scripting::WeakLifetimeScope scope, ::std::string const& lookupName);
99
100 MCAPI static void bind(::Scripting::ModuleBindingBuilder& moduleBuilder, ::ItemRegistryRef itemRegistry);
101
102 MCAPI static ::std::unordered_map<::std::string, ::std::string>
103 generateItemPropertyNameToRawNameMap(::ItemRegistryRef itemRegistry, bool allowAirBlockItem);
104
105#ifdef LL_PLAT_S
106 MCAPI static ::std::vector<::std::string> generatetItemCooldownCategories(::ItemRegistryRef itemRegistry);
107#endif
108
109 MCAPI static ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
110 getOrCreateItemTypeHandle(::Scripting::WeakLifetimeScope scope, ::std::string const& identifier);
111 // NOLINTEND
112
113public:
114 // constructor thunks
115 // NOLINTBEGIN
116 MCAPI void* $ctor(::ItemRegistryRef itemRegistry);
117 // NOLINTEND
118
119public:
120 // destructor thunk
121 // NOLINTBEGIN
122 MCAPI void $dtor();
123 // NOLINTEND
124};
125
126} // namespace ScriptModuleMinecraft
Definition HashedString.h:5
Definition ItemRegistryRef.h:42
Definition ScriptItemType.h:16
Definition ModuleBindingBuilder.h:31
Definition StrongTypedObjectHandle.h:8
Definition WeakLifetimeScope.h:14