From dfec29dac594a4411430db9fb9b1e95cbe37abb7 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sun, 1 Nov 2026 07:43:39 +0100 Subject: [PATCH] Offer fight instead of local in /chat on arenas --- .../steamwar/velocitycore/commands/ChatCommand.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/ChatCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/ChatCommand.java index fcb3f456..e0994512 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/ChatCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/ChatCommand.java @@ -30,6 +30,7 @@ import de.steamwar.messages.PlayerChatter; import de.steamwar.sql.UserPerm; import de.steamwar.velocitycore.chat.ChatChannel; import de.steamwar.velocitycore.chat.ChatManager; +import de.steamwar.velocitycore.chat.LocalChannel; import java.util.ArrayList; import java.util.Collection; @@ -84,6 +85,7 @@ public class ChatCommand extends SWCommand { return switch (s.toLowerCase()) { case "global" -> ChatManager.getGlobal(); case "local" -> sender.getPlayer() == null ? null : ChatManager.currentLocal(sender.getPlayer()); + case "fight" -> onArena(sender) ? ChatManager.currentLocal(sender.getPlayer()) : null; case "team", "tc" -> sender.user().getTeam() != 0 ? ChatManager.team(sender.user().getTeam()) : null; case "serverteam", "stc" -> sender.user().hasPerm(UserPerm.TEAM) ? ChatManager.getServerTeam() : null; default -> arena(sender, s); @@ -97,7 +99,8 @@ public class ChatCommand extends SWCommand { @Override public Collection tabCompletes(Chatter sender, PreviousArguments previousArguments, String s) { - List channels = new ArrayList<>(List.of("global", "local")); + // On arenas the local chat is the fight chat + List channels = new ArrayList<>(List.of("global", onArena(sender) ? "fight" : "local")); if (sender.user().getTeam() != 0) channels.add("team"); if (sender.user().hasPerm(UserPerm.TEAM)) channels.add("serverteam"); if (sender.user().hasPerm(UserPerm.MODERATION)) { @@ -108,6 +111,13 @@ public class ChatCommand extends SWCommand { }; } + private static boolean onArena(Chatter sender) { + if (sender.getPlayer() == null) return false; + + LocalChannel local = ChatManager.currentLocal(sender.getPlayer()); + return local != null && local.isArena(); + } + /** * Moderators can address the fight chat of every fight server by its server name. */