From 4d53e8ced92a2b491222f29f4e74cadacd5a36aa Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 22 Apr 2022 16:14:35 +0200 Subject: [PATCH] Fix chatcolor, arenacommand Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/commands/ArenaCommand.java | 5 +++-- src/de/steamwar/bungeecore/listeners/ChatListener.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/ArenaCommand.java b/src/de/steamwar/bungeecore/commands/ArenaCommand.java index 15241cf..339c66a 100644 --- a/src/de/steamwar/bungeecore/commands/ArenaCommand.java +++ b/src/de/steamwar/bungeecore/commands/ArenaCommand.java @@ -19,8 +19,8 @@ package de.steamwar.bungeecore.commands; -import de.steamwar.bungeecore.Arenaserver; import de.steamwar.bungeecore.Message; +import de.steamwar.bungeecore.Servertype; import de.steamwar.bungeecore.Subserver; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; @@ -40,7 +40,8 @@ public class ArenaCommand extends BasicCommand { ProxiedPlayer player = (ProxiedPlayer) sender; ServerInfo server = ProxyServer.getInstance().getServerInfo(String.join(" ", args)); - if(server == null || !(Subserver.getSubserver(server) instanceof Arenaserver)) { + Subserver subserver = Subserver.getSubserver(server); + if(server == null || subserver == null || subserver.getType() != Servertype.ARENA) { Message.send("ARENA_NOT_FOUND", player); return; } diff --git a/src/de/steamwar/bungeecore/listeners/ChatListener.java b/src/de/steamwar/bungeecore/listeners/ChatListener.java index 7775dea..81c4fff 100644 --- a/src/de/steamwar/bungeecore/listeners/ChatListener.java +++ b/src/de/steamwar/bungeecore/listeners/ChatListener.java @@ -68,6 +68,7 @@ public class ChatListener extends BasicListener { } else { e.setCancelled(true); + //TODO /arena Subserver subserver = Subserver.getSubserver(player); if(subserver instanceof Arenaserver && subserver.getServer() == player.getServer().getInfo()) { localChat(player, message); @@ -162,7 +163,7 @@ public class ChatListener extends BasicListener { sender.getTeam() == 0 ? "" : "§" + Team.get(sender.getTeam()).getTeamColor() + Team.get(sender.getTeam()).getTeamKuerzel() + " ", UserElo.getEmblem(sender), group.getColorCode(), - group.getChatPrefix().length() == 0 ? "" : group.getChatPrefix() + " ", + group.getChatPrefix().length() == 0 ? "§f" : group.getChatPrefix() + " ", group.getChatColorCode())); }