SteamWar/BungeeCore
Archiviert
13
2

Fix Arenaserver
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-04-22 17:10:32 +02:00
Ursprung 4d53e8ced9
Commit 329d80f037
4 geänderte Dateien mit 6 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -116,7 +116,7 @@ public class Message {
} }
public static void broadcast(String message, String onHover, ClickEvent onClick, Object... params) { public static void broadcast(String message, String onHover, ClickEvent onClick, Object... params) {
ChatSender.allReceivers().forEach(player -> player.prefixless(message, new Message(onHover, params), onClick, params)); ChatSender.allReceivers().forEach(player -> player.prefixless(message, onHover != null ? new Message(onHover, params) : null, onClick, params));
} }
public static void team(String message, Object... params) { public static void team(String message, Object... params) {
@ -124,7 +124,7 @@ public class Message {
} }
public static void team(String message, String onHover, ClickEvent onClick, Object... params) { public static void team(String message, String onHover, ClickEvent onClick, Object... params) {
ChatSender.serverteamReceivers().filter(player -> player.user().getUserGroup().isTeamGroup()).forEach(player -> player.prefixless(message, new Message(onHover, params), onClick, params)); ChatSender.serverteamReceivers().filter(player -> player.user().getUserGroup().isTeamGroup()).forEach(player -> player.prefixless(message, onHover != null ? new Message(onHover, params) : null, onClick, params));
} }
private final String format; private final String format;

Datei anzeigen

@ -81,7 +81,7 @@ public class TpCommand extends BasicCommand {
String serverPerm = BungeeCore.serverPermissions.get(server.getName()); String serverPerm = BungeeCore.serverPermissions.get(server.getName());
Subserver subserver = Subserver.getSubserver(server); Subserver subserver = Subserver.getSubserver(server);
if (subserver instanceof Arenaserver) { if (subserver != null && subserver.getType() == Servertype.ARENA) {
if (!sender.user().isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer)) if (!sender.user().isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer))
SubserverSystem.sendPlayer(subserver, player); SubserverSystem.sendPlayer(subserver, player);

Datei anzeigen

@ -68,9 +68,8 @@ public class ChatListener extends BasicListener {
} else { } else {
e.setCancelled(true); e.setCancelled(true);
//TODO /arena
Subserver subserver = Subserver.getSubserver(player); Subserver subserver = Subserver.getSubserver(player);
if(subserver instanceof Arenaserver && subserver.getServer() == player.getServer().getInfo()) { if(subserver != null && subserver.getType() == Servertype.ARENA && subserver.getServer() == player.getServer().getInfo()) {
localChat(player, message); localChat(player, message);
} else if (message.startsWith("+")) { } else if (message.startsWith("+")) {
localChat(player, message.substring(1)); localChat(player, message.substring(1));

Datei anzeigen

@ -19,10 +19,7 @@
package de.steamwar.messages; package de.steamwar.messages;
import de.steamwar.bungeecore.Arenaserver; import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.Subserver;
import de.steamwar.bungeecore.bot.listeners.DiscordChatListener; import de.steamwar.bungeecore.bot.listeners.DiscordChatListener;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.ChatMessageType;
@ -59,7 +56,7 @@ public interface ChatSender {
static Stream<ChatSender> globalReceivers() { static Stream<ChatSender> globalReceivers() {
return all().filter(player -> { return all().filter(player -> {
Subserver subserver = Subserver.getSubserver(player); Subserver subserver = Subserver.getSubserver(player);
return !(subserver instanceof Arenaserver && subserver.getServer() == player.getServer().getInfo()); return subserver == null || !(subserver.getType() == Servertype.ARENA && subserver.getServer() == player.getServer().getInfo());
}).map(ChatSender::of); }).map(ChatSender::of);
} }