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/script_core/lifetime_registry/scripting/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
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 // member functions
52 // NOLINTBEGIN
53 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
54 _registerItemType(
55 ::std::unordered_map<
56 ::std::string,
59 ::std::string itemName,
60 bool allowAirBlockItem
61 );
62
63 MCAPI void _registerItems(::Scripting::WeakLifetimeScope& scope, bool allowAirBlockItem);
64
65 MCAPI void _tryRegisterItemTypeAlias(::HashedString const& aliasName);
66
67 MCAPI ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
68 get(::Scripting::WeakLifetimeScope& scope, ::std::string const& itemName, bool allowAirBlockItem);
69
70 MCAPI ::std::vector<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
71 getAll(::Scripting::WeakLifetimeScope& scope, bool allowAirBlockItem);
72 // NOLINTEND
73
74public:
75 // static functions
76 // NOLINTBEGIN
77 MCAPI static ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
78 _getOrCreateItemTypeHandle(::Scripting::WeakLifetimeScope scope, ::std::string const& lookupName);
79
80 MCAPI static void bind(::Scripting::ModuleBindingBuilder& moduleBuilder, ::ItemRegistryRef itemRegistry);
81
82 MCAPI static ::std::unordered_map<::std::string, ::std::string>
83 generateItemPropertyNameToRawNameMap(::ItemRegistryRef itemRegistry, bool allowAirBlockItem);
84
85#ifdef LL_PLAT_S
86 MCAPI static ::std::vector<::std::string> generatetItemCooldownCategories(::ItemRegistryRef itemRegistry);
87#endif
88
89 MCAPI static ::std::optional<::Scripting::StrongTypedObjectHandle<::ScriptModuleMinecraft::ScriptItemType>>
90 getOrCreateItemTypeHandle(::Scripting::WeakLifetimeScope scope, ::std::string const& identifier);
91 // NOLINTEND
92};
93
94} // namespace ScriptModuleMinecraft
Definition HashedString.h:5
Definition ItemRegistryRef.h:41
Definition ScriptItemType.h:16
Definition ScriptItems.h:19
Definition ModuleBindingBuilder.h:22
Definition StrongTypedObjectHandle.h:8
Definition WeakLifetimeScope.h:12