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/deps/core/string/HashedString.h"
7#include "mc/server/commands/CommandOutputType.h"
8#include "mc/server/commands/CommandPermissionLevel.h"
9#include "mc/server/commands/CurrentCmdVersion.h"
10
11// auto generated forward declare list
12// clang-format off
14class ActorFactory;
15class BaseGameVersion;
16class CameraPresets;
17class Command;
18class CommandContext;
19class CommandOrigin;
20class CommandOutput;
22class CommandRegistry;
24class Experiments;
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#ifdef LL_PLAT_C
100 MCAPI ::MCRESULT requestCommandExecution(
101 ::std::unique_ptr<::CommandOrigin> origin,
102 ::std::string const& commandLine,
103 int version,
104 bool suppressOutput
105 );
106
107 MCAPI void tick();
108#endif
109 // NOLINTEND
110
111public:
112 // static functions
113 // NOLINTBEGIN
114 MCAPI static ::CommandOutputType getOutputType(::CommandOrigin const& origin);
115
116 MCAPI static void initBlockEnum(::CommandRegistry& registry, ::BaseGameVersion const& worldBaseGameVersion);
117
118 MCAPI static void
119 initEntityEnum(::CommandRegistry& registry, ::ActorFactory const& actorFactory, ::Experiments const& experiments);
120
121 MCAPI static void initEntityPropertyEnum(::CommandRegistry& registry, ::Level const& level);
122
123 MCAPI static void initItemEnum(
124 ::ItemRegistryRef itemRegistry,
125 ::CommandRegistry& registry,
126 ::BaseGameVersion const& worldBaseGameVersion
127 );
128
129 MCAPI static void initItemTagEnum(::ItemRegistryRef itemRegistry, ::CommandRegistry& registry);
130
131 MCAPI static void initStructureFeatureEnum(
132 ::CommandRegistry& registry,
133 ::Experiments const& experiments,
134 ::br::worldgen::StructureRegistry const& structureRegistry
135 );
136
137 MCAPI static void initUnlockableRecipesEnum(::CommandRegistry& registry, ::Recipes const& recipes);
138
139 MCAPI static void registerSharedClientServerEnums(::CommandRegistry& registry);
140 // NOLINTEND
141
142public:
143 // constructor thunks
144 // NOLINTBEGIN
145 MCAPI void* $ctor(::MinecraftCommandsArguments&& args);
146 // NOLINTEND
147
148public:
149 // destructor thunk
150 // NOLINTBEGIN
151 MCAPI void $dtor();
152 // NOLINTEND
153
154public:
155 // vftables
156 // NOLINTBEGIN
157 MCNAPI static void** $vftable();
158 // NOLINTEND
159};
Definition ActorDefinitionGroup.h:36
Definition ActorFactory.h:33
Definition BaseGameVersion.h:8
Definition CameraPresets.h:20
Definition CommandContext.h:10
Definition CommandOrigin.h:32
Definition CommandOutputSender.h:19
Definition CommandOutput.h:20
Definition CommandRegistry.h:50
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:250
static MCAPI void ** $vftable()
Definition Recipes.h:36
Definition StructureRegistry.h:12
Definition MCRESULT.h:8
Definition MinecraftCommandsArguments.h:11
Definition context.h:5