mirror of
https://github.com/System-End/Discord-MC-Chat.git
synced 2026-04-19 19:45:14 +00:00
新增MinecraftEventPacket类
This commit is contained in:
parent
17e95520b5
commit
32660368d2
1 changed files with 42 additions and 0 deletions
|
|
@ -0,0 +1,42 @@
|
|||
package com.xujiayao.discord_mc_chat.network.packets;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Packet sent from Minecraft Client to DMCC Server containing an in-game event or message.
|
||||
*
|
||||
* @author Xujiayao
|
||||
*/
|
||||
public class MinecraftEventPacket extends Packet {
|
||||
public MessageType type;
|
||||
public Map<String, String> placeholders;
|
||||
|
||||
public MinecraftEventPacket(MessageType type, Map<String, String> placeholders) {
|
||||
this.type = type;
|
||||
this.placeholders = placeholders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enum representing the type of message being sent.
|
||||
*
|
||||
* @author Xujiayao
|
||||
*/
|
||||
public enum MessageType {
|
||||
// Server events
|
||||
SERVER_STARTED,
|
||||
SERVER_STOPPING,
|
||||
SERVER_STOPPED,
|
||||
|
||||
// Player events
|
||||
PLAYER_JOIN,
|
||||
PLAYER_QUIT,
|
||||
PLAYER_CHAT,
|
||||
PLAYER_COMMAND,
|
||||
PLAYER_DIE,
|
||||
PLAYER_ADVANCEMENT,
|
||||
|
||||
// Source events
|
||||
SOURCE_SAY,
|
||||
SOURCE_TELL_RAW
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue