mirror of
https://github.com/System-End/Discord-MC-Chat.git
synced 2026-04-19 16:28:23 +00:00
Add message source configurations and update event handling
This commit is contained in:
parent
c57ef52bdd
commit
b6b83d1664
4 changed files with 9 additions and 8 deletions
|
|
@ -27,7 +27,6 @@ public class MinecraftEventPacket extends Packet {
|
|||
// Server events
|
||||
SERVER_STARTED,
|
||||
SERVER_STOPPING,
|
||||
SERVER_STOPPED,
|
||||
|
||||
// Player events
|
||||
PLAYER_JOIN,
|
||||
|
|
@ -37,8 +36,8 @@ public class MinecraftEventPacket extends Packet {
|
|||
PLAYER_DIE,
|
||||
PLAYER_ADVANCEMENT,
|
||||
|
||||
// Source events
|
||||
SOURCE_SAY,
|
||||
SOURCE_TELL_RAW
|
||||
// Player & Source events
|
||||
CHAT,
|
||||
ME
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,8 +107,6 @@ public class ServerHandler extends SimpleChannelInboundHandler<Packet> {
|
|||
case PLAYER_ADVANCEMENT ->
|
||||
DiscordManager.clientBroadcast(clientName, "player.advancement", "player.advancement." + p.placeholders.get("type"), false, p.placeholders);
|
||||
// TODO Unhandled events
|
||||
default ->
|
||||
LOGGER.warn("Received MinecraftEventPacket from authenticated client {}: type={}, placeholders={}", clientName, p.type, p.placeholders);
|
||||
}
|
||||
}
|
||||
case InfoResponsePacket p -> NetworkManager.cacheInfoResponse(clientName, p);
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ broadcasts:
|
|||
source:
|
||||
say: "in-game-chat"
|
||||
tell_raw: "in-game-chat"
|
||||
msg: "in-game-chat" # msg / tell / w
|
||||
me: "in-game-chat"
|
||||
|
||||
# 消息格式设置
|
||||
message_parsing:
|
||||
|
|
@ -83,8 +85,8 @@ message_parsing:
|
|||
excluded_commands:
|
||||
- "/msg (?!@a)(.*)"
|
||||
- "/tell (?!@a)(.*)"
|
||||
- "/tellraw (?!@a)(.*)"
|
||||
- "/w (?!@a)(.*)"
|
||||
- "/tellraw (?!@a)(.*)"
|
||||
- "/teammsg (.*)"
|
||||
- "/tm (.*)"
|
||||
- "/login (.*)"
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@ broadcasts:
|
|||
source:
|
||||
say: "in-game-chat"
|
||||
tell_raw: "in-game-chat"
|
||||
msg: "in-game-chat" # msg / tell / w
|
||||
me: "in-game-chat"
|
||||
|
||||
# 消息格式设置
|
||||
message_parsing:
|
||||
|
|
@ -100,8 +102,8 @@ message_parsing:
|
|||
excluded_commands:
|
||||
- "/msg (?!@a)(.*)"
|
||||
- "/tell (?!@a)(.*)"
|
||||
- "/tellraw (?!@a)(.*)"
|
||||
- "/w (?!@a)(.*)"
|
||||
- "/tellraw (?!@a)(.*)"
|
||||
- "/teammsg (.*)"
|
||||
- "/tm (.*)"
|
||||
- "/login (.*)"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue