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;
31// clang-format on
32
33class MinecraftCommands {
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&);
50 MinecraftCommands(MinecraftCommands const&);
51 MinecraftCommands();
52
53public:
54 // virtual functions
55 // NOLINTBEGIN
56 virtual ~MinecraftCommands() = default;
57 // NOLINTEND
58
59public:
60 // member functions
61 // NOLINTBEGIN
62 MCAPI explicit MinecraftCommands(::MinecraftCommandsArguments&& args);
63
64 MCAPI ::Command* compileCommand(
65 ::HashedString const& commandStr,
66 ::CommandOrigin& origin,
67 ::CurrentCmdVersion commandVersion,
68 ::std::function<void(::std::string const&)> onParserError
69 );
70
71 MCAPI void enqueueDeferredCommand(
72 ::std::unique_ptr<::CommandContext> context,
73 bool suppressOutput,
74 bool isRequest,
75 ::std::function<void(::MCRESULT)> callback
76 );
77
78 MCAPI void
79 enqueueDeferredCompiledCommand(::gsl::not_null<::Command*> command, ::std::unique_ptr<::CommandOrigin> origin);
80
81 MCAPI ::MCRESULT executeCommand(::CommandContext& context, bool suppressOutput) const;
82
83 MCAPI void handleOutput(::CommandOrigin const& origin, ::CommandOutput const& output) const;
84
85 MCAPI void initCoreEnums(
86 ::ItemRegistryRef itemRegistry,
87 ::Level const& level,
88 ::ActorFactory const& actorFactory,
89 ::Experiments const& experiments,
90 ::BaseGameVersion const& worldBaseGameVersion
91 );
92
93 MCAPI void initCoreEnumsServer(
94 ::ActorDefinitionGroup const& actorDefinitionGroup,
95 ::CameraPresets const& cameraPresets,
96 ::Recipes const& recipes
97 );
98
99#ifdef LL_PLAT_C
100 MCAPI void registerChatPermissionsCallback(::std::function<bool()> callback);
101
102 MCAPI ::MCRESULT requestCommandExecution(::CommandContext& context, bool suppressOutput);
103
104 MCAPI ::MCRESULT requestCommandExecution(
105 ::std::unique_ptr<::CommandOrigin> origin,
106 ::std::string const& commandLine,
107 int version,
108 bool suppressOutput
109 );
110#endif
111
112 MCAPI void
113 runCommand(::HashedString const& commandStr, ::CommandOrigin& origin, ::CurrentCmdVersion commandVersion);
114
115 MCAPI void tick();
116 // NOLINTEND
117
118public:
119 // static functions
120 // NOLINTBEGIN
121 MCAPI static ::CommandOutputType getOutputType(::CommandOrigin const& origin);
122
123 MCAPI static void registerSharedClientServerEnums(::CommandRegistry& registry);
124 // NOLINTEND
125
126public:
127 // constructor thunks
128 // NOLINTBEGIN
129 MCAPI void* $ctor(::MinecraftCommandsArguments&& args);
130 // NOLINTEND
131
132public:
133 // vftables
134 // NOLINTBEGIN
135 MCNAPI static void** $vftable();
136 // NOLINTEND
137};
Definition ActorDefinitionGroup.h:26
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:51
Definition Command.h:17
Definition DeferredCommandBase.h:10
Definition Experiments.h:14
Definition HashedString.h:5
Definition ICommandsContextProvider.h:15
Definition ItemRegistryRef.h:41
Definition Level.h:254
static MCAPI void ** $vftable()
Definition Recipes.h:37
Definition MCRESULT.h:8
Definition MinecraftCommandsArguments.h:11
Definition context.h:5