-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommandExecutor.java
50 lines (44 loc) · 1.39 KB
/
CommandExecutor.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package net.jailgens.enchanted;
import org.jetbrains.annotations.NotNull;
import java.util.Map;
/**
* Something that can execute (run) commands.
* <p>
* Not to be confused with bukkit's command executor.
*
* @author Sparky983
* @since 0.0.0
*/
public interface CommandExecutor {
/**
* Sends the specified message to the command executor.
*
* @param message the message.
* @throws NullPointerException if the message is {@code null}.
* @since 0.0.0
*/
void sendMessage(@NotNull String message);
/**
* Sends a translated message to the command executor.
*
* @param key the translation key.
* @param placeholders the message placeholders.
* @throws NullPointerException if the key or arguments are {@code null}.
* @see TranslationKey
* @since 0.1.0
*/
void sendTranslatedMessage(
@NotNull String key, @NotNull Map<@NotNull String, @NotNull Object> placeholders);
/**
* Gets an alternative executor that doesn't have to implement {@link CommandExecutor}.
* <p>
* This can be used so consumers can use other command executors such as Bukkit's
* {@code CommandSender} interface.
* <p>
* If there is no alternative executor, it is valid to return {@code this}.
*
* @return the alternative executor.
* @since 0.1.0
*/
@NotNull Object getAlternativeExecutor();
}