LeviLamina
Loading...
Searching...
No Matches
ExecuteCommandEvent.h
1
#pragma once
2
3
#include "ll/api/base/Macro.h"
4
#include "ll/api/event/Cancellable.h"
5
#include "ll/api/event/Event.h"
6
7
#include "mc/deps/core/utility/MCRESULT.h"
8
#include "mc/server/commands/CommandContext.h"
9
#include "mc/server/commands/MinecraftCommands.h"
10
11
namespace
ll::event::inline command {
12
13
class
ExecuteCommandEvent
:
public
Event {
14
MinecraftCommands
& mMinecraftCommands;
15
16
protected
:
17
CommandContext
& mCommandContext;
18
bool
& mSuppressOutput;
19
20
constexpr
explicit
ExecuteCommandEvent
(
21
MinecraftCommands
& minecraftCommands,
22
CommandContext
& commandContext,
23
bool
& suppressOutput
24
)
25
: mMinecraftCommands(minecraftCommands),
26
mCommandContext(commandContext),
27
mSuppressOutput(suppressOutput) {}
28
29
public
:
30
LLAPI
void
serialize
(
CompoundTag
&)
const override
;
31
32
LLNDAPI
MinecraftCommands
& minecraftCommands()
const
;
33
LLNDAPI
CommandContext
const
& commandContext()
const
;
34
LLNDAPI
bool
const
& suppressOutput()
const
;
35
};
36
class
ExecutingCommandEvent
final :
public
Cancellable<ExecuteCommandEvent> {
37
public
:
38
constexpr
explicit
ExecutingCommandEvent
(
39
MinecraftCommands
& minecraftCommands,
40
CommandContext
& commandContext,
41
bool
& suppressOutput
42
)
43
: Cancellable(minecraftCommands, commandContext, suppressOutput) {}
44
45
LLAPI
void
deserialize(
CompoundTag
const
&)
override
;
46
47
LLNDAPI
CommandContext
& commandContext()
const
;
48
LLNDAPI
bool
& suppressOutput()
const
;
49
};
50
class
ExecutedCommandEvent
final :
public
ExecuteCommandEvent
{
51
MCRESULT
& mResult;
52
53
public
:
54
constexpr
explicit
ExecutedCommandEvent
(
55
MCRESULT
& result,
56
MinecraftCommands
& minecraftCommands,
57
CommandContext
& commandContext,
58
bool
& suppressOutput
59
)
60
:
ExecuteCommandEvent
(minecraftCommands, commandContext, suppressOutput),
61
mResult(result) {}
62
63
LLAPI
void
serialize
(
CompoundTag
&)
const override
;
64
65
LLNDAPI
MCRESULT
& result()
const
;
66
};
67
}
// namespace ll::event::inline command
CommandContext
Definition
CommandContext.h:10
CompoundTag
Definition
CompoundTag.h:13
MinecraftCommands
Definition
MinecraftCommands.h:33
command::ExecuteCommandEvent
Definition
ExecuteCommandEvent.h:13
command::ExecutedCommandEvent
Definition
ExecuteCommandEvent.h:50
command::ExecutingCommandEvent
Definition
ExecuteCommandEvent.h:36
MCRESULT
Definition
MCRESULT.h:8
serialize
Definition
serialize.h:11
src
ll
api
event
command
ExecuteCommandEvent.h
Generated on Fri Jun 13 2025 05:04:17 for LeviLamina by
1.12.0