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;
31namespace br::worldgen { class StructureRegistry; }
32// clang-format on
33
34class MinecraftCommands {
35public:
36 // member variables
37 // NOLINTBEGIN
38 ::ll::TypedStorage<8, 8, ::ICommandsContextProvider&> mContextProvider;
39 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CommandRegistry>> mRegistry;
40 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CommandOutputSender>> mOutputSender;
41 ::ll::TypedStorage<1, 1, ::CommandPermissionLevel> mOpPermissionLevel;
42 ::ll::TypedStorage<8, 64, ::std::function<bool()>> mChatPermissionsCallback;
43 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::std::unique_ptr<::Command>>> mCompiledCommandMap;
44 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::DeferredCommandBase>>> mDeferredCommands;
45 ::ll::TypedStorage<8, 8, uint64> mDeferredScriptCommandCount;
46 // NOLINTEND
47
48public:
49 // prevent constructor by default
50 MinecraftCommands& operator=(MinecraftCommands const&);
51 MinecraftCommands(MinecraftCommands const&);
52 MinecraftCommands();
53
54public:
55 // virtual functions
56 // NOLINTBEGIN
57 virtual ~MinecraftCommands();
58 // NOLINTEND
59
60public:
61 // member functions
62 // NOLINTBEGIN
63 MCAPI explicit MinecraftCommands(::MinecraftCommandsArguments&& args);
64
65 MCAPI ::Command* compileCommand(
66 ::HashedString const& commandStr,
67 ::CommandOrigin& origin,
68 ::CurrentCmdVersion commandVersion,
69 ::std::function<void(::std::string const&)> onParserError
70 );
71
72 MCAPI void enqueueDeferredCommand(
73 ::std::unique_ptr<::CommandContext> context,
74 bool suppressOutput,
75 bool isRequest,
76 ::std::function<void(::MCRESULT)> callback
77 );
78
79 MCAPI ::MCRESULT executeCommand(::CommandContext& context, bool suppressOutput) const;
80
81 MCAPI void handleOutput(::CommandOrigin const& origin, ::CommandOutput const& output) const;
82
83 MCAPI void initCoreEnums(
84 ::ItemRegistryRef itemRegistry,
85 ::Level const& level,
86 ::ActorFactory const& actorFactory,
87 ::Experiments const& experiments,
88 ::BaseGameVersion const& worldBaseGameVersion
89 );
90
91 MCAPI void initCoreEnumsServer(
92 ::ActorDefinitionGroup const& actorDefinitionGroup,
93 ::CameraPresets const& cameraPresets,
94 ::Recipes const& recipes
95 );
96
97 MCAPI ::MCRESULT requestCommandExecution(::CommandContext& context, bool suppressOutput);
98
99 MCAPI_C ::MCRESULT requestCommandExecution(
100 ::std::unique_ptr<::CommandOrigin> origin,
101 ::std::string const& commandLine,
102 int version,
103 bool suppressOutput
104 );
105
106 MCAPI_C void tick();
107 // NOLINTEND
108
109public:
110 // static functions
111 // NOLINTBEGIN
112 MCAPI static ::CommandOutputType getOutputType(::CommandOrigin const& origin);
113
114 MCAPI static void initBlockEnum(::CommandRegistry& registry, ::BaseGameVersion const& worldBaseGameVersion);
115
116 MCAPI static void
117 initEntityEnum(::CommandRegistry& registry, ::ActorFactory const& actorFactory, ::Experiments const& experiments);
118
119 MCAPI static void initEntityPropertyEnum(::CommandRegistry& registry, ::Level const& level);
120
121 MCAPI static void initItemEnum(
122 ::ItemRegistryRef itemRegistry,
123 ::CommandRegistry& registry,
124 ::BaseGameVersion const& worldBaseGameVersion
125 );
126
127 MCAPI static void initItemTagEnum(::ItemRegistryRef itemRegistry, ::CommandRegistry& registry);
128
129 MCAPI static void initStructureFeatureEnum(
130 ::CommandRegistry& registry,
131 ::Experiments const& experiments,
132 ::br::worldgen::StructureRegistry const& structureRegistry
133 );
134
135 MCAPI static void initUnlockableRecipesEnum(::CommandRegistry& registry, ::Recipes const& recipes);
136
137 MCAPI static void registerSharedClientServerEnums(::CommandRegistry& registry);
138 // NOLINTEND
139
140public:
141 // constructor thunks
142 // NOLINTBEGIN
143 MCAPI void* $ctor(::MinecraftCommandsArguments&& args);
144 // NOLINTEND
145
146public:
147 // destructor thunk
148 // NOLINTBEGIN
149 MCAPI void $dtor();
150 // NOLINTEND
151
152public:
153 // vftables
154 // NOLINTBEGIN
155 MCNAPI static void** $vftable();
156 // NOLINTEND
157};
Definition ActorDefinitionGroup.h:35
Definition ActorFactory.h:34
Definition BaseGameVersion.h:8
Definition CameraPresets.h:22
Definition CommandContext.h:10
Definition CommandOrigin.h:32
Definition CommandOutputSender.h:16
Definition CommandOutput.h:19
Definition CommandRegistry.h:47
Definition Command.h:17
Definition DeferredCommandBase.h:10
Definition Experiments.h:14
Definition HashedString.h:5
Definition ICommandsContextProvider.h:15
Definition ItemRegistryRef.h:36
Definition Level.h:249
static MCAPI void ** $vftable()
Definition Recipes.h:35
Definition StructureRegistry.h:12
Definition MCRESULT.h:8
Definition MinecraftCommandsArguments.h:5
Definition context.h:5