mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 17:05:20 +01:00
Fix command map
This commit is contained in:
30
src/main/java/emu/grasscutter/command/CommandHandler.java
Normal file
30
src/main/java/emu/grasscutter/command/CommandHandler.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package emu.grasscutter.command;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.game.GenshinPlayer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CommandHandler {
|
||||
/**
|
||||
* Send a message to the target.
|
||||
*
|
||||
* @param player The player to send the message to, or null for the server console.
|
||||
* @param message The message to send.
|
||||
*/
|
||||
static void sendMessage(GenshinPlayer player, String message) {
|
||||
if (player == null) {
|
||||
Grasscutter.getLogger().info(message);
|
||||
} else {
|
||||
player.dropMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player/console invokes a command.
|
||||
* @param sender The player/console that invoked the command.
|
||||
* @param args The arguments to the command.
|
||||
*/
|
||||
default void execute(GenshinPlayer sender, List<String> args) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user