Rework chat into Velocity-managed channels

Chat is now handled entirely by VelocityCore through channels with
separate readers and writers (Global, Local/Fight, Blue/Red fight team,
Team, ServerTeam, Alert and 1:1 direct messages). Each player has a
saved default channel; messages from other channels are tagged with
the channel name, and every default change is announced.

- /global, /local, /tc, /stc, /msg and /r switch the default channel
  when called without a message
- /chat <channel> switches, /chat <channel> join|leave toggles reading
  (saved); moderators can join arenas by name and write with
  /chat <channel> msg <text>
- '+' sends from global to local and from local/fight to the fight team
- Referees write yellow in the fight chat
- Subservers no longer receive chat; arenas get a record-only
  ChatRecordPacket so replays keep their chat
- Remove the chat listeners of SpigotCore, FightSystem, MissileWars,
  TowerRun and TNTLeague

Closes #460, #129
This commit is contained in:
2026-10-15 19:55:25 +02:00
parent d727982ce0
commit 9fe05b59e4
37 changed files with 1607 additions and 372 deletions
@@ -53,6 +53,3 @@ DEALER_REDSTONE = §eRedstone
DEALER_BLOCKS = §eBlocks
DEALER_TOOLS = §eTools
DEALER_ANGLES = §eAngle Blocks
PARTICIPANT_CHAT = {0} {1}§8» §7{2}
SPECTATOR_CHAT = §7{0}§8» §7{1}
@@ -22,7 +22,6 @@ package de.steamwar.tntleague.events
import de.steamwar.tntleague.config.TNTLeagueWorldConfig
import de.steamwar.tntleague.game.TNTLeagueGame
import de.steamwar.tntleague.game.TNTLeagueTeam
import de.steamwar.tntleague.message
import de.steamwar.tntleague.plugin
import org.bukkit.GameMode
import org.bukkit.Material
@@ -90,20 +89,4 @@ object GlobalListener : Listener {
null -> e.respawnLocation = TNTLeagueWorldConfig.lobby
}
}
@EventHandler
fun handlePlayerChat(event: AsyncPlayerChatEvent) {
val player = event.player
val msg = event.message
val fightTeam = TNTLeagueGame.getTeam(player)
if (fightTeam != null) {
message.broadcastPrefixless("PARTICIPANT_CHAT", fightTeam.name, player.name, msg)
} else {
message.broadcastPrefixless("SPECTATOR_CHAT", player.name, msg)
}
event.isCancelled = true
}
}