Class ChatLogic
java.lang.Object
us.talabrek.ultimateskyblock.chat.ChatLogic
The primary logic of uSkyBlocks chat-handling
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
getFormat
(us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type) Gets the message format for the givenIslandChatEvent.Type
.@NotNull List<org.bukkit.entity.Player>
getRecipients
(org.bukkit.entity.Player sender, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type chatType) Gets aList
containingPlayer
's with all the recipients that should receive the given messageIslandChatEvent.Type
from the sendingPlayer
.@Nullable us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type
getToggle
(org.bukkit.entity.Player player) Gets the currentIslandChatEvent.Type
toggle for the givenPlayer
, or null if none exists.void
sendMessage
(org.bukkit.entity.Player sender, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type, String message) Sends the given message to all online partymembers or island visitors on the givenPlayer
's island, depending on the givenIslandChatEvent.Type
.boolean
toggle
(org.bukkit.entity.Player player, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type) Toggle theIslandChatEvent.Type
on or off for the givenPlayer
, returns true if it is toggled on.
-
Constructor Details
-
ChatLogic
-
-
Method Details
-
getRecipients
@NotNull public @NotNull List<org.bukkit.entity.Player> getRecipients(org.bukkit.entity.Player sender, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type chatType) Gets aList
containingPlayer
's with all the recipients that should receive the given messageIslandChatEvent.Type
from the sendingPlayer
. Returns an empty list when there are no recipients.- Parameters:
sender
- Player sending the message.chatType
- Message type that the player is sending.- Returns:
- List of all recipients, or an empty list if there are none.
-
sendMessage
public void sendMessage(org.bukkit.entity.Player sender, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type, String message) Sends the given message to all online partymembers or island visitors on the givenPlayer
's island, depending on the givenIslandChatEvent.Type
.- Parameters:
sender
- Player sending the message.type
- Message type to send.message
- Message to send.
-
getFormat
@NotNull public @NotNull String getFormat(us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type) Gets the message format for the givenIslandChatEvent.Type
.- Parameters:
type
- Island chat type to lookup.- Returns:
- Message format.
-
toggle
public boolean toggle(org.bukkit.entity.Player player, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type) Toggle theIslandChatEvent.Type
on or off for the givenPlayer
, returns true if it is toggled on.- Parameters:
player
- Player to toggle the chat type for.type
- Chat type to toggle.- Returns:
- True if it is toggled on, false otherwise.
-
getToggle
@Nullable public @Nullable us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type getToggle(org.bukkit.entity.Player player) Gets the currentIslandChatEvent.Type
toggle for the givenPlayer
, or null if none exists.- Parameters:
player
- Player to lookup.- Returns:
- The current Type toggle, or null if none exists.
-