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& operator=(ScriptItems const&);
53 ScriptItems();
54
55public:
56 // member functions
57 // NOLINTBEGIN
58 MCAPI ScriptItems(::ScriptModuleMinecraft::ScriptItems const&);
59
60 MCAPI explicit ScriptItems(::ItemRegistryRef itemRegistry);
61
62 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
63 _getItemHandleForAlias(::HashedString const& aliasName) const;
64
65 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
66 _registerItemType(
67 ::std::unordered_map<
68 ::std::string,
71 ::std::string itemName,
72 bool allowAirBlockItem
73 );
74
75 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
76 _registerItemTypeAlias(
77 ::std::string itemName,
79 );
80
81 MCAPI void _registerItems(::Scripting::WeakLifetimeScope& scope, bool allowAirBlockItem);
82
83 MCAPI void _tryRegisterItemTypeAlias(::HashedString const& aliasName);
84
85 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
86 get(::Scripting::WeakLifetimeScope& scope, ::std::string const& itemName, bool allowAirBlockItem);
87
88 MCAPI ::std::vector<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
89 getAll(::Scripting::WeakLifetimeScope& scope, bool allowAirBlockItem);
90
91 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
92 getOrAdd(::Scripting::WeakLifetimeScope& scope, ::std::string const& itemName, bool allowAirBlockItem);
93 // NOLINTEND
94
95public:
96 // static functions
97 // NOLINTBEGIN
98 MCAPI static ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
99 _getOrCreateItemTypeHandle(::Scripting::WeakLifetimeScope scope, ::std::string const& lookupName);
100
101 MCAPI static void bind(::Scripting::ModuleBindingBuilder& moduleBuilder, ::ItemRegistryRef itemRegistry);
102
103 MCAPI static ::std::unordered_map<::std::string, ::std::string>
104 generateItemPropertyNameToRawNameMap(::ItemRegistryRef itemRegistry, bool allowAirBlockItem);
105
106 MCAPI_S static ::std::vector<::std::string> generatetItemCooldownCategories(::ItemRegistryRef itemRegistry);
107
108 MCAPI static ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
109 getOrCreateItemTypeHandle(::Scripting::WeakLifetimeScope scope, ::std::string const& identifier);
110 // NOLINTEND
111
112public:
113 // constructor thunks
114 // NOLINTBEGIN
115 MCAPI void* $ctor(::ScriptModuleMinecraft::ScriptItems const&);
116
117 MCAPI void* $ctor(::ItemRegistryRef itemRegistry);
118 // NOLINTEND
119};
120
121} // namespace ScriptModuleMinecraft
Definition HashedString.h:5
Definition ItemRegistryRef.h:36
Definition ScriptItemType.h:16
Definition ScriptItems.h:19
Definition ModuleBindingBuilder.h:27
Definition StrongTypedObjectHandle.h:8
Definition WeakLifetimeScope.h:7