LeviLamina
Loading...
Searching...
No Matches
ScriptSpawnRulesRegistry.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/deps/scripting/runtime/Result.h"
8#include "mc/deps/scripting/script_engine/Closure.h"
9#include "mc/world/level/chunk/EntitySpawnReason.h"
10
11// auto generated forward declare list
12// clang-format off
13class BlockPos;
14class BlockSource;
15class Mob;
16namespace ScriptModuleMinecraft { class ScriptCustomSpawnRulesRegistry; }
17namespace ScriptModuleMinecraft { class ScriptEntitySpawnCallbackArgs; }
18namespace ScriptModuleMinecraft { class ScriptObstructionCallbackArgs; }
19namespace ScriptModuleMinecraft { struct ScriptNamespaceNameError; }
20namespace ScriptModuleMinecraft { struct ScriptSpawnRulesInvalidRegistryError; }
21namespace Scripting { class WeakLifetimeScope; }
22namespace Scripting { struct ClassBinding; }
23namespace Scripting { struct InvalidArgumentError; }
24namespace br::spawn { struct EntityType; }
25// clang-format on
26
27namespace ScriptModuleMinecraft {
28
29class ScriptSpawnRulesRegistry {
30public:
31 // ScriptSpawnRulesRegistry inner types define
32 using EntitySpawnCallback = ::Scripting::Closure<
34
35 using ObstructionCallback = ::Scripting::Closure<
37
38public:
39 // member variables
40 // NOLINTBEGIN
41 ::ll::TypedStorage<8, 8, ::ScriptModuleMinecraft::ScriptCustomSpawnRulesRegistry&> mRegistry;
42 // NOLINTEND
43
44public:
45 // prevent constructor by default
46 ScriptSpawnRulesRegistry& operator=(ScriptSpawnRulesRegistry const&);
47 ScriptSpawnRulesRegistry(ScriptSpawnRulesRegistry const&);
48 ScriptSpawnRulesRegistry();
49
50public:
51 // member functions
52 // NOLINTBEGIN
53 MCAPI explicit ScriptSpawnRulesRegistry(::ScriptModuleMinecraft::ScriptCustomSpawnRulesRegistry& registry);
54
55 MCAPI ::Scripting::Result<
56 void,
60 registerEntitySpawnCallback(
62 ::std::string const& id,
65 );
66
67 MCAPI ::Scripting::Result<
68 void,
72 registerObstructionCallback(
74 ::std::string const& id,
77 );
78 // NOLINTEND
79
80public:
81 // static functions
82 // NOLINTBEGIN
83 MCAPI static ::Scripting::ClassBinding bind();
84
85 MCAPI static bool entitySpawnCallbackHandler(
89 callback,
90 ::br::spawn::EntityType const& entityType,
91 ::BlockSource& region,
92 ::br::spawn::EntitySpawnReason& spawnReason,
93 ::BlockPos blockPosition
94 );
95
96 MCAPI static bool obstructionCallbackHandler(
100 callback,
101 ::BlockSource& region,
102 ::Mob const& mob,
103 ::br::spawn::EntityType const& entityType
104 );
105 // NOLINTEND
106
107public:
108 // constructor thunks
109 // NOLINTBEGIN
111 // NOLINTEND
112};
113
114} // namespace ScriptModuleMinecraft
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Mob.h:57
Definition ScriptCustomSpawnRulesRegistry.h:26
Definition ScriptEntitySpawnCallbackArgs.h:22
Definition ScriptObstructionCallbackArgs.h:22
Definition Closure.h:8
Definition StrongTypedObjectHandle.h:8
Definition WeakLifetimeScope.h:14
Definition ScriptNamespaceNameError.h:18
Definition ScriptSpawnRulesInvalidRegistryError.h:17
Definition ClassBinding.h:19
Definition InvalidArgumentError.h:17
Definition EntityType.h:17