Package com.palmergames.bukkit.towny
Class TownyMessaging
java.lang.Object
com.palmergames.bukkit.towny.TownyMessaging
Towny message handling class
- Author:
- ElgarL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.kyori.adventure.text.Component
getPageNavigationFooter
(String prefix, int page, String arg, int total, Translator translator) static void
sendActionBarMessageToPlayer
(org.bukkit.entity.Player player, String message) Send an ActionBar message to the given player.static void
sendActionBarMessageToPlayer
(org.bukkit.entity.Player player, net.kyori.adventure.text.Component component) Send an ActionBar message to the given player.static void
sendBossBarMessageToPlayer
(org.bukkit.entity.Player player, String message, float progress, net.kyori.adventure.bossbar.BossBar.Color color, net.kyori.adventure.bossbar.BossBar.Overlay overlay) static void
sendBossBarMessageToPlayer
(org.bukkit.entity.Player player, net.kyori.adventure.bossbar.BossBar bossBar) static void
sendBossBarMessageToPlayer
(org.bukkit.entity.Player player, net.kyori.adventure.text.Component component, float progress, net.kyori.adventure.bossbar.BossBar.Color color, net.kyori.adventure.bossbar.BossBar.Overlay overlay) static void
sendConfirmationMessage
(org.bukkit.command.CommandSender sender, Confirmation confirmation) Sends a player click-able confirmation messages.static void
sendDebugMsg
(String msg) Sends a message to the debug logger (and hence the console and debug.log)static void
sendDevMsg
(String msg) Sends a message (red) to the named Dev (if DevMode is enabled) Uses default_towny_prefixstatic void
sendDevMsg
(String[] msg) Sends a message (red) to the named Dev (if DevMode is enabled) Uses default_towny_prefixstatic void
sendErrorMsg
(Translatable message) Sends a translatable error message to the console, prefixed by [Towny] Error:static void
sendErrorMsg
(Object sender, String msg) Sends an Error message (red) to the Player or console and to the named Dev if DevMode is enabled.static void
sendErrorMsg
(String msg) Sends an error message to the logstatic void
sendErrorMsg
(org.bukkit.command.CommandSender sender, Translatable translatable) Sends an Error message (red) to the sender and to the named Dev if DevMode is enabled.static void
sendErrorMsg
(org.bukkit.command.CommandSender sender, Translatable... translatables) Sends an Error message (red) to the sender and to the named Dev if DevMode is enabled.static void
sendGlobalMessage
(Translatable translatable) Send a message to All online players and the log.static void
sendGlobalMessage
(String line) Send a message to All online players and the log.static void
sendInvitationMessage
(org.bukkit.command.CommandSender player, String firstline, String confirmline, String cancelline) Sends a player click-able invitation messages.static void
sendJailList
(org.bukkit.command.CommandSender sender, Town town, int page, int total) static void
sendMessage
(Object sender, String line) Send a message.static void
sendMessage
(Object sender, String[] lines) Send a message to a player with no Towny prefix.static void
sendMessage
(Object sender, List<String> lines) Send a message to a player with no Towny prefix.static void
sendMessage
(org.bukkit.command.CommandSender sender, Translatable translatable) Sends a message translated to the end-user's locale, with no prefix.static void
sendMessage
(org.bukkit.command.CommandSender sender, Translatable... translatables) Sends a message translated to the end-user's locale, with no prefix.static void
sendMsg
(Resident resident, Translatable message) Send a translatable message to a resident if they are online, prefixed by the default_towny_prefix.static void
sendMsg
(Translatable message) Sends a translatable message to the console, prefixed by the default_towny_prefix.static void
Sends a message to console only prefixed by [Towny]static void
sendMsg
(org.bukkit.command.CommandSender sender, Translatable translatable) Sends a message in green, prefixed by the default_towny_prefix to the sender, translated to the end-user's locale.static void
sendMsg
(org.bukkit.command.CommandSender sender, Translatable... translatables) Sends a message in green, prefixed by the default_towny_prefix to the sender, translated to the end-user's locale.static void
Towny's main endpoint for Towny-Prefixed messages.static void
sendMsgToOnlineAdmins
(Translatable message) Send a message to All online ops or players with towny.admin, and the log.static void
sendNationBoard
(org.bukkit.command.CommandSender sender, Nation nation) Send the nation board to a player (in yellow)static void
sendNationList
(org.bukkit.command.CommandSender sender, List<Pair<UUID, net.kyori.adventure.text.Component>> nations, ComparatorType compType, int page, int total) static void
sendNationMessagePrefixed
(Nation nation, Translatable message) Send a message to All online residents of a nation and log, preceded by the default_towny_prefixstatic void
sendOutpostList
(org.bukkit.entity.Player player, Town town, int page, int total) static void
sendPlainGlobalMessage
(String line) Send a message to All online players and the log.static void
sendPlotGroupList
(org.bukkit.command.CommandSender sender, Town town, int page, int total) static void
sendPlotList
(org.bukkit.command.CommandSender sender, Resident resident, int page, int totalPages) static void
sendPrefixedNationMessage
(Nation nation, Translatable message) Send a message to All online residents of a nation and log preceded by the [NationName], translated for the end-user.static void
sendPrefixedNationMessage
(Nation nation, String line) Send a message to All online residents of a nation and log with the [nationname] prefixed to the beginningstatic void
sendPrefixedTownMessage
(Resident resident, Translatable message) Sends a message to all online residents of the specified resident's town, if they have one.static void
sendPrefixedTownMessage
(Town town, Translatable message) Send a message to All online residents of a town and log preceded by the [Townname], translated for the end-user.static void
sendPrefixedTownMessage
(Town town, String line) Send a message to All online residents of a town and log preceded by the [Townname]static void
sendRequestMessage
(org.bukkit.command.CommandSender player, Invite invite) static void
sendStatusScreen
(org.bukkit.command.CommandSender sender, StatusScreen screen) static void
Send the player a Title message with default duration (70 ticks.)static void
Send the player a Title message for a specified number of ticks.static void
sendTitleMessageToNation
(Nation nation, String title, String subtitle) Send a Title and Subtitle to a nation with default duration (70 ticks.)static void
sendTitleMessageToNation
(Nation nation, String title, String subtitle, int duration) Send a Title and Subtitle to a nation for a specified number of ticks.static void
sendTitleMessageToResident
(Resident resident, String title, String subtitle) Send a Title and Subtitle to a resident with default duration (70 ticks.)static void
sendTitleMessageToResident
(Resident resident, String title, String subtitle, int duration) Send a Title and Subtitle to a resident for a specified number of ticks.static void
sendTitleMessageToTown
(Town town, String title, String subtitle) Send a Title and Subtitle to a town with default duration (70 ticks.)static void
sendTitleMessageToTown
(Town town, String title, String subtitle, int duration) Send a Title and Subtitle to a town for a specified number of ticks.static void
sendTownBoard
(org.bukkit.command.CommandSender sender, Town town) Send the town board to a player (in yellow)static void
sendTownList
(org.bukkit.command.CommandSender sender, List<Pair<UUID, net.kyori.adventure.text.Component>> towns, ComparatorType compType, int page, int total) static void
sendTownMessagePrefixed
(Town town, Translatable message) Send a message to All online residents of a town and log, preceded by the default_towny_prefix
-
Constructor Details
-
TownyMessaging
public TownyMessaging()
-
-
Method Details
-
sendErrorMsg
Sends an error message to the log- Parameters:
msg
- message to send
-
sendErrorMsg
Sends an Error message (red) to the Player or console and to the named Dev if DevMode is enabled. Uses default_towny_prefix. If msg is empty nothing will be sent.- Parameters:
sender
- the Object sending the messagemsg
- the message to send
-
sendMsg
Sends a message to console only prefixed by [Towny]- Parameters:
msg
- the message to be sent
-
sendMsg
Towny's main endpoint for Towny-Prefixed messages. Sends a message (green) to the Player or console and to the named Dev if DevMode is enabled. Uses default_towny_prefix- Parameters:
sender
- the CommandSender receiving the msgmsg
- the message being sent
-
sendDevMsg
Sends a message (red) to the named Dev (if DevMode is enabled) Uses default_towny_prefix- Parameters:
msg
- the message to be sent
-
sendDevMsg
Sends a message (red) to the named Dev (if DevMode is enabled) Uses default_towny_prefix- Parameters:
msg
- the message to be sent
-
sendDebugMsg
Sends a message to the debug logger (and hence the console and debug.log)- Parameters:
msg
- the message to be sent
-
sendMessage
Send a message. This is the main end point for all String based messages before being sent to the eventual reader.- Parameters:
sender
- the Object sending the messageline
- the String to send
-
sendMessage
Send a message to a player with no Towny prefix.- Parameters:
sender
- the Object sending the messagelines
- List of strings to send
-
sendMessage
Send a message to a player with no Towny prefix.- Parameters:
sender
- the Object sending the messagelines
- String array to send as message.
-
sendGlobalMessage
Send a message to All online players and the log. Uses default_towny_prefix- Parameters:
line
- the message to send
-
sendPlainGlobalMessage
Send a message to All online players and the log. Does not use the default_towny_prefix.- Parameters:
line
- the message to send.
-
sendPrefixedTownMessage
Send a message to All online residents of a town and log preceded by the [Townname]- Parameters:
town
- the town to pass the message to, and prefix message withline
- the actual message
-
sendPrefixedNationMessage
Send a message to All online residents of a nation and log with the [nationname] prefixed to the beginning- Parameters:
nation
- nation to send to, and prefix message withline
- the message
-
sendTownBoard
Send the town board to a player (in yellow)- Parameters:
sender
- sender to show totown
- the town for which to show it's board
-
sendNationBoard
Send the nation board to a player (in yellow)- Parameters:
sender
- Sender to show tonation
- the nation for which to show it's board
-
sendTitleMessageToResident
public static void sendTitleMessageToResident(Resident resident, String title, String subtitle, int duration) Send a Title and Subtitle to a resident for a specified number of ticks.- Parameters:
resident
- Resident to receive title & subtitle message.title
- Title message to send.subtitle
- Subtitle message to send.duration
- Number of ticks to display the message.
-
sendTitleMessageToResident
Send a Title and Subtitle to a resident with default duration (70 ticks.)- Parameters:
resident
- Resident to receive title & subtitle message.title
- Title message to send.subtitle
- Subtitle message to send.
-
sendTitleMessageToTown
Send a Title and Subtitle to a town for a specified number of ticks.- Parameters:
town
- Town to receive title & subtitle messages.title
- Title message to send.subtitle
- Subtitle message to send.duration
- Number of ticks to display the message.
-
sendTitleMessageToTown
Send a Title and Subtitle to a town with default duration (70 ticks.)- Parameters:
town
- Town to receive title & subtitle messages.title
- Title message to send.subtitle
- Subtitle message to send.
-
sendTitleMessageToNation
public static void sendTitleMessageToNation(Nation nation, String title, String subtitle, int duration) Send a Title and Subtitle to a nation for a specified number of ticks.- Parameters:
nation
- Nation to receive title & subtitle messages.title
- Title message to send.subtitle
- Subtitle message to send.duration
- Number of ticks to display the message.
-
sendTitleMessageToNation
Send a Title and Subtitle to a nation with default duration (70 ticks.)- Parameters:
nation
- Nation to receive title & subtitle messages.title
- Title message to send.subtitle
- Subtitle message to send.
-
sendTitle
public static void sendTitle(org.bukkit.entity.Player player, String title, String subtitle, int duration) Send the player a Title message for a specified number of ticks.As of MC 1.18 a null title will mean the message is never sent, so we are changing empty Strings to " ".
- Parameters:
player
- Player being send the Title message.title
- String title message.subtitle
- String subtitle message.duration
- How long the title is shown for in ticks.
-
sendTitle
Send the player a Title message with default duration (70 ticks.)- Parameters:
player
- Player being send the Title message.title
- String title message.subtitle
- String subtitle message.
-
sendRequestMessage
-
sendInvitationMessage
public static void sendInvitationMessage(org.bukkit.command.CommandSender player, String firstline, String confirmline, String cancelline) Sends a player click-able invitation messages.- Parameters:
player
- - The player (CommandSender) to send the confirmationfirstline
- - The question regarding the confirmation.confirmline
- - Line for sending the confirmation.cancelline
- - Line for sending the cancellation.
-
sendConfirmationMessage
public static void sendConfirmationMessage(org.bukkit.command.CommandSender sender, Confirmation confirmation) Sends a player click-able confirmation messages.- Parameters:
sender
- - The player (CommandSender) to send the confirmationconfirmation
- - Confirmation to send to the player.
-
sendTownList
public static void sendTownList(org.bukkit.command.CommandSender sender, List<Pair<UUID, net.kyori.adventure.text.Component>> towns, ComparatorType compType, int page, int total) -
sendNationList
public static void sendNationList(org.bukkit.command.CommandSender sender, List<Pair<UUID, net.kyori.adventure.text.Component>> nations, ComparatorType compType, int page, int total) -
sendOutpostList
-
sendJailList
public static void sendJailList(org.bukkit.command.CommandSender sender, Town town, int page, int total) -
sendPlotGroupList
public static void sendPlotGroupList(org.bukkit.command.CommandSender sender, Town town, int page, int total) -
sendPlotList
public static void sendPlotList(org.bukkit.command.CommandSender sender, Resident resident, int page, int totalPages) -
sendMsg
Sends a message in green, prefixed by the default_towny_prefix to the sender, translated to the end-user's locale.- Parameters:
sender
- CommandSender who will see the message.translatables
- Translatable object(s) which will be translated, joined with a space.- See Also:
-
sendMsg
Sends a message in green, prefixed by the default_towny_prefix to the sender, translated to the end-user's locale.- Parameters:
sender
- CommandSender who will see the message.translatable
- Translatable object which will be translated.
-
sendMessage
public static void sendMessage(org.bukkit.command.CommandSender sender, Translatable... translatables) Sends a message translated to the end-user's locale, with no prefix.- Parameters:
sender
- CommandSender who will see the message.translatables
- Translatable... object(s) which will be translated.- See Also:
-
sendMessage
Sends a message translated to the end-user's locale, with no prefix.- Parameters:
sender
- CommandSender who will see the message.translatable
- Translatable object which will be translated.
-
sendErrorMsg
public static void sendErrorMsg(org.bukkit.command.CommandSender sender, Translatable... translatables) Sends an Error message (red) to the sender and to the named Dev if DevMode is enabled. Uses default_towny_prefix. Translates to the end-user's locale.- Parameters:
sender
- CommandSender who will receive the error message.translatables
- Translatable... object(s) to be translated using the locale of the end-user.- See Also:
-
sendErrorMsg
Sends an Error message (red) to the sender and to the named Dev if DevMode is enabled. Uses default_towny_prefix. Translates to the end-user's locale.- Parameters:
sender
- CommandSender who will receive the error message.translatable
- Translatable object to be translated using the locale of the end-user.
-
sendGlobalMessage
Send a message to All online players and the log. Uses default_towny_prefix. Message is translated for the end-user.- Parameters:
translatable
- Translatable object to be messaged to the player using their locale.
-
sendPrefixedNationMessage
Send a message to All online residents of a nation and log preceded by the [NationName], translated for the end-user.- Parameters:
nation
- Nation to pass the message to, prefix message with.message
- Translatable object to be messaged to the player using their locale.
-
sendPrefixedTownMessage
Send a message to All online residents of a town and log preceded by the [Townname], translated for the end-user.- Parameters:
town
- Town to pass the message to, and prefix message with.message
- Translatable object to be messaged to the player using their locale.
-
sendPrefixedTownMessage
Sends a message to all online residents of the specified resident's town, if they have one. If the resident does not have a town, the message will be sent to the resident instead.- Parameters:
resident
- The resident.message
- The translatable message to be sent to the resident and/or their town.
-
sendNationMessagePrefixed
Send a message to All online residents of a nation and log, preceded by the default_towny_prefix- Parameters:
nation
- Nation which will receive the message.message
- Translatable message to be shown to the town.
-
sendTownMessagePrefixed
Send a message to All online residents of a town and log, preceded by the default_towny_prefix- Parameters:
town
- Town which will receive the message.message
- Translatable message to be shown to the town.
-
sendMsg
Send a translatable message to a resident if they are online, prefixed by the default_towny_prefix.- Parameters:
resident
- Resident to receive the message.message
- Translatable message for the resident.
-
sendMsg
Sends a translatable message to the console, prefixed by the default_towny_prefix.- Parameters:
message
- Translatable message to show the console.
-
sendErrorMsg
Sends a translatable error message to the console, prefixed by [Towny] Error:- Parameters:
message
- Translatable error message to show the console.
-
sendMsgToOnlineAdmins
Send a message to All online ops or players with towny.admin, and the log.- Parameters:
message
- Translatable message to send.
-
sendStatusScreen
-
sendActionBarMessageToPlayer
Send an ActionBar message to the given player.- Parameters:
player
-Player
who will be shown the message.message
-String
message which will be made into aTextComponent
and shown in the ActioBar.
-
sendActionBarMessageToPlayer
public static void sendActionBarMessageToPlayer(org.bukkit.entity.Player player, net.kyori.adventure.text.Component component) Send an ActionBar message to the given player.- Parameters:
player
-Player
who will be shown the message.component
-Component
message which will be shown to the player.
-
sendBossBarMessageToPlayer
public static void sendBossBarMessageToPlayer(org.bukkit.entity.Player player, String message, float progress, net.kyori.adventure.bossbar.BossBar.Color color, net.kyori.adventure.bossbar.BossBar.Overlay overlay) -
sendBossBarMessageToPlayer
public static void sendBossBarMessageToPlayer(org.bukkit.entity.Player player, net.kyori.adventure.text.Component component, float progress, net.kyori.adventure.bossbar.BossBar.Color color, net.kyori.adventure.bossbar.BossBar.Overlay overlay) -
sendBossBarMessageToPlayer
public static void sendBossBarMessageToPlayer(org.bukkit.entity.Player player, net.kyori.adventure.bossbar.BossBar bossBar)
-