Add message source configurations and update event handling

This commit is contained in:
Xujiayao 2026-03-19 09:42:56 +08:00
parent c57ef52bdd
commit b6b83d1664
4 changed files with 9 additions and 8 deletions

View file

@ -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
}
}

View file

@ -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);

View file

@ -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 (.*)"

View file

@ -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 (.*)"