Class StringFormatter
java.lang.Object
me.github.simonplays15.betterbansystem.core.chat.StringFormatter
The StringFormatter class provides methods for formatting messages related to bans
and kicks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull String
formatBanMessage
(@NotNull IBanEntry entry) Formats a ban message for a given ban entry.static @NotNull String
formatIpBanMessage
(@NotNull IIPBanEntry entry) Formats an IP ban message using the given IIPBanEntry.static @NotNull String
formatKickMessage
(String sender, String reason) Formats a kick message by replacing placeholders in the kick message template with the sender and reason.
-
Constructor Details
-
StringFormatter
public StringFormatter()
-
-
Method Details
-
formatKickMessage
@Contract("_, _ -> new") @NotNull public static @NotNull String formatKickMessage(String sender, String reason) Formats a kick message by replacing placeholders in the kick message template with the sender and reason.- Parameters:
sender
- the sender of the kick messagereason
- the reason for the kick- Returns:
- the formatted kick message
-
formatBanMessage
@Contract("_, -> new") @NotNull public static @NotNull String formatBanMessage(@NotNull @NotNull IBanEntry entry) Formats a ban message for a given ban entry.- Parameters:
entry
- the ban entry to format the message for- Returns:
- the formatted ban message
-
formatIpBanMessage
@Contract("_, -> new") @NotNull public static @NotNull String formatIpBanMessage(@NotNull @NotNull IIPBanEntry entry) Formats an IP ban message using the given IIPBanEntry.- Parameters:
entry
- The IIPBanEntry containing the ban details.- Returns:
- The formatted IP ban message.
-