SteamWar/BungeeCore
Archiviert
13
2
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-11-22 08:49:54 +01:00
Ursprung 8c3df0e1dd
Commit d9f1617235
2 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -170,6 +170,8 @@ public class BungeeCore extends Plugin {
send(player, ChatMessageType.SYSTEM, msg, onHover, onClick); send(player, ChatMessageType.SYSTEM, msg, onHover, onClick);
} }
public static void send(ProxiedPlayer player, ChatMessageType type, String msg, String onHover, ClickEvent onClick){ public static void send(ProxiedPlayer player, ChatMessageType type, String msg, String onHover, ClickEvent onClick){
if(type == ChatMessageType.CHAT && player.getChatMode() != ProxiedPlayer.ChatMode.SHOWN)
return;
TextComponent message = stringToText(msg); TextComponent message = stringToText(msg);
if(onHover != null) if(onHover != null)
message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(onHover))); message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(onHover)));

Datei anzeigen

@ -88,6 +88,8 @@ public class Message {
} }
public static void send(String message, boolean prefixed, CommandSender sender, ChatMessageType type, String onHover, ClickEvent onClick, Object... params){ public static void send(String message, boolean prefixed, CommandSender sender, ChatMessageType type, String onHover, ClickEvent onClick, Object... params){
if(type == ChatMessageType.CHAT && sender instanceof ProxiedPlayer && ((ProxiedPlayer)sender).getChatMode() != ProxiedPlayer.ChatMode.SHOWN)
return;
TextComponent msg = parseToComponent(message, prefixed, sender, params); TextComponent msg = parseToComponent(message, prefixed, sender, params);
if(onHover != null) if(onHover != null)
msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(onHover))); msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(onHover)));