mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 18:56:15 +00:00
add CommandResponseEvent
This commit is contained in:
parent
10fe5d11ca
commit
0c6521806c
@ -2,6 +2,8 @@ package emu.grasscutter.command;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.server.event.game.CommandResponseEvent;
|
||||
import emu.grasscutter.server.event.types.ServerEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -19,6 +21,8 @@ public interface CommandHandler {
|
||||
} else {
|
||||
player.dropMessage(message);
|
||||
}
|
||||
CommandResponseEvent event = new CommandResponseEvent(ServerEvent.Type.GAME,player, message);
|
||||
event.call();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,24 @@
|
||||
package emu.grasscutter.server.event.game;
|
||||
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.server.event.types.GameEvent;
|
||||
import emu.grasscutter.server.event.types.ServerEvent;
|
||||
|
||||
public class CommandResponseEvent extends ServerEvent {
|
||||
private String message;
|
||||
private Player player;
|
||||
|
||||
public CommandResponseEvent(Type type, Player player,String message) {
|
||||
super(type);
|
||||
this.message = message;
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user