LeviLamina
Loading...
Searching...
No Matches
MinecraftCommands.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/server/commands/CommandOutputType.h"
7#include "mc/server/commands/CommandPermissionLevel.h"
8#include "mc/server/commands/CurrentCmdVersion.h"
9
10// auto generated forward declare list
11// clang-format off
13class ActorFactory;
14class BaseGameVersion;
15class CameraPresets;
16class Command;
17class CommandContext;
18class CommandOrigin;
19class CommandOutput;
21class CommandRegistry;
23class Experiments;
24class HashedString;
26class ItemRegistryRef;
27class Level;
28class Recipes;
29struct MCRESULT;
30namespace br::worldgen { class StructureRegistry; }
31// clang-format on
32
34public:
35 // member variables
36 // NOLINTBEGIN
37 ::ll::TypedStorage<8, 8, ::ICommandsContextProvider&> mContextProvider;
38 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CommandRegistry>> mRegistry;
39 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CommandOutputSender>> mOutputSender;
40 ::ll::TypedStorage<1, 1, ::CommandPermissionLevel> mOpPermissionLevel;
41 ::ll::TypedStorage<8, 64, ::std::function<bool()>> mChatPermissionsCallback;
42 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::std::unique_ptr<::Command>>> mCompiledCommandMap;
43 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::DeferredCommandBase>>> mDeferredCommands;
44 ::ll::TypedStorage<8, 8, uint64> mDeferredScriptCommandCount;
45 // NOLINTEND
46
47public:
48 // prevent constructor by default
49 MinecraftCommands& operator=(MinecraftCommands const&);
52
53public:
54 // virtual functions
55 // NOLINTBEGIN
56 // vIndex: 0
57 virtual ~MinecraftCommands();
58 // NOLINTEND
59
60public:
61 // member functions
62 // NOLINTBEGIN
63 MCAPI
64 MinecraftCommands(::ICommandsContextProvider& contextProvider, ::std::unique_ptr<::CommandRegistry>&& registry);
65
66 MCAPI ::Command* compileCommand(
67 ::HashedString const& commandStr,
68 ::CommandOrigin& origin,
69 ::CurrentCmdVersion commandVersion,
70 ::std::function<void(::std::string const&)> onParserError
71 );
72
73 MCAPI void enqueueDeferredCommand(
74 ::std::unique_ptr<::CommandContext> context,
75 bool suppressOutput,
76 bool isRequest,
77 ::std::function<void(::MCRESULT)> callback
78 );
79
80 MCAPI ::MCRESULT executeCommand(::CommandContext& context, bool suppressOutput) const;
81
82 MCAPI void handleOutput(::CommandOrigin const& origin, ::CommandOutput const& output) const;
83
84 MCAPI void initCoreEnums(
85 ::ItemRegistryRef itemRegistry,
86 ::Level const& level,
87 ::ActorFactory const& actorFactory,
88 ::Experiments const& experiments,
89 ::BaseGameVersion const& worldBaseGameVersion
90 );
91
92 MCAPI void initCoreEnumsServer(
93 ::ActorDefinitionGroup const& actorDefinitionGroup,
94 ::CameraPresets const& cameraPresets,
95 ::Recipes const& recipes
96 );
97
98 MCAPI ::MCRESULT requestCommandExecution(::CommandContext& context, bool suppressOutput);
99 // NOLINTEND
100
101public:
102 // static functions
103 // NOLINTBEGIN
104 MCAPI static ::CommandOutputType getOutputType(::CommandOrigin const& origin);
105
106 MCAPI static void initBlockEnum(::CommandRegistry& registry, ::BaseGameVersion const& worldBaseGameVersion);
107
108 MCAPI static void
109 initEntityEnum(::CommandRegistry& registry, ::ActorFactory const& actorFactory, ::Experiments const& experiments);
110
111 MCAPI static void initEntityPropertyEnum(::CommandRegistry& registry, ::Level const& level);
112
113 MCAPI static void initItemEnum(
114 ::ItemRegistryRef itemRegistry,
115 ::CommandRegistry& registry,
116 ::BaseGameVersion const& worldBaseGameVersion
117 );
118
119 MCAPI static void initItemTagEnum(::ItemRegistryRef itemRegistry, ::CommandRegistry& registry);
120
121 MCAPI static void initStructureFeatureEnum(
122 ::CommandRegistry& registry,
123 ::Experiments const& experiments,
124 ::br::worldgen::StructureRegistry const& structureRegistry
125 );
126
127 MCAPI static void initUnlockableRecipesEnum(::CommandRegistry& registry, ::Recipes const& recipes);
128
129 MCAPI static void registerSharedClientServerEnums(::CommandRegistry& registry);
130 // NOLINTEND
131
132public:
133 // constructor thunks
134 // NOLINTBEGIN
135 MCAPI void* $ctor(::ICommandsContextProvider& contextProvider, ::std::unique_ptr<::CommandRegistry>&& registry);
136 // NOLINTEND
137
138public:
139 // destructor thunk
140 // NOLINTBEGIN
141 MCAPI void $dtor();
142 // NOLINTEND
143
144public:
145 // vftables
146 // NOLINTBEGIN
147 MCNAPI static void** $vftable();
148 // NOLINTEND
149};
Definition ActorDefinitionGroup.h:29
Definition ActorFactory.h:32
Definition BaseGameVersion.h:8
Definition CameraPresets.h:18
Definition CommandContext.h:10
Definition CommandOrigin.h:32
Definition CommandOutputSender.h:15
Definition CommandOutput.h:19
Definition CommandRegistry.h:45
Definition Command.h:17
Definition DeferredCommandBase.h:10
Definition Experiments.h:14
Definition HashedString.h:5
Definition ICommandsContextProvider.h:15
Definition ItemRegistryRef.h:31
Definition Level.h:238
Definition MinecraftCommands.h:33
static MCAPI void ** $vftable()
Definition Recipes.h:36
Definition StructureRegistry.h:12
Definition MCRESULT.h:8
Definition context.h:5