Skip to content

Commit

Permalink
Update Chat interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Brikster committed Dec 19, 2023
1 parent 0701370 commit 061ac29
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/src/main/java/ru/brikster/chatty/api/chat/Chat.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.kyori.adventure.sound.Sound;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -114,6 +115,16 @@ default Collection<? extends Player> getRecipients(@Nullable Player sender) {
return Collections.unmodifiableCollection(onlinePlayers);
}

/**
* This method let you send any message to the chat participants (without applying {@link Chat#getFormat()})
*
* @param plugin plugin that uses Chatty API
* @param message legacy message with section symbol to send
*/
default void sendMessage(Plugin plugin, String message) {
sendMessage(plugin, LegacyComponentSerializer.legacySection().deserialize(message), recipient -> true);
}

/**
* This method let you send any message to the chat participants (without applying {@link Chat#getFormat()})
*
Expand Down

0 comments on commit 061ac29

Please sign in to comment.