Class FancyMessage
- java.lang.Object
-
- me.bimmr.bimmcore.messages.fancymessage.FancyMessage
-
public class FancyMessage extends java.lang.Object
A Utilities/Builder class for the BaseComponents API
-
-
Constructor Summary
Constructors Constructor Description FancyMessage()
Default ConstructorFancyMessage(java.lang.String string)
Constructor with first textFancyMessage(FancyMessage fancyMessage)
-
Method Summary
Modifier and Type Method Description FancyMessage
changePage(java.lang.String page)
Change the page in a bookFancyMessage
command(java.lang.String string)
The command the player will use/say when they message the messagesnet.md_5.bungee.api.chat.BaseComponent[]
getBaseComponents()
FancyMessage
link(java.lang.String string)
Opens the link for the player when they message the messagesFancyMessage
onClick(FancyClick fce)
CAN NOT BE USED WITH COMMAND Add a callback for an onClick CallBack self deletes after 5 minutes from first message, unless told otherwiseFancyMessage
onClick(FancyClickEvent fce)
FancyMessage
say(java.lang.String string)
The message the player will use/say when they message the messagesvoid
send(org.bukkit.entity.Player player)
Sends the messages to a playervoid
send(org.bukkit.entity.Player[] players)
Sends the messages to an array of playersvoid
sendToConsole(org.bukkit.command.CommandSender sender)
Sends the fancy messages in the form of plain text to the consoleFancyMessage
showItem(org.bukkit.inventory.ItemStack item)
FancyMessage
suggest(java.lang.String string)
Autotypes a messages into their chatbar when they message the messagesFancyMessage
then(java.lang.String string)
Adds a new string section to the messages, this allows new tooltips, and events.FancyMessage
then(FancyMessage fancyMessage)
java.lang.String
toJSON()
FancyMessage
tooltip(java.lang.String... strings)
Tooltips are what appear when you hover over the messagesjava.lang.String
toPlainText()
-
-
-
Constructor Detail
-
FancyMessage
public FancyMessage()
Default Constructor
-
FancyMessage
public FancyMessage(java.lang.String string)
Constructor with first text- Parameters:
string
- the String to start with
-
FancyMessage
public FancyMessage(FancyMessage fancyMessage)
-
-
Method Detail
-
then
public FancyMessage then(java.lang.String string)
Adds a new string section to the messages, this allows new tooltips, and events.- Parameters:
string
- The String to add- Returns:
- The FancyMessage
-
then
public FancyMessage then(FancyMessage fancyMessage)
-
tooltip
public FancyMessage tooltip(java.lang.String... strings)
Tooltips are what appear when you hover over the messages- Parameters:
strings
- The tooltips to add- Returns:
- The FancyMessage
-
showItem
public FancyMessage showItem(org.bukkit.inventory.ItemStack item)
-
command
public FancyMessage command(java.lang.String string)
The command the player will use/say when they message the messages- Parameters:
string
- The command to run- Returns:
- The FancyMessage
-
say
public FancyMessage say(java.lang.String string)
The message the player will use/say when they message the messages- Parameters:
string
- The command to run- Returns:
- The FancyMessage
-
changePage
public FancyMessage changePage(java.lang.String page)
Change the page in a book- Parameters:
page
- The page to change to- Returns:
- The FancyMessage
-
onClick
public FancyMessage onClick(FancyClick fce)
CAN NOT BE USED WITH COMMAND Add a callback for an onClick CallBack self deletes after 5 minutes from first message, unless told otherwise- Parameters:
fce
- The FancyClickEvent- Returns:
- The FancyMessage
-
onClick
public FancyMessage onClick(FancyClickEvent fce)
-
suggest
public FancyMessage suggest(java.lang.String string)
Autotypes a messages into their chatbar when they message the messages- Parameters:
string
- The String to type- Returns:
- The FancyMessage
-
link
public FancyMessage link(java.lang.String string)
Opens the link for the player when they message the messages- Parameters:
string
- The link- Returns:
- The FancyMessage
-
send
public void send(org.bukkit.entity.Player player)
Sends the messages to a player- Parameters:
player
- The player
-
send
public void send(org.bukkit.entity.Player[] players)
Sends the messages to an array of players- Parameters:
players
- The players
-
getBaseComponents
public net.md_5.bungee.api.chat.BaseComponent[] getBaseComponents()
- Returns:
- Get all the BaseComponents
-
toJSON
public java.lang.String toJSON()
- Returns:
- Get the FancyMessage as JSON
-
sendToConsole
public void sendToConsole(org.bukkit.command.CommandSender sender)
Sends the fancy messages in the form of plain text to the console- Parameters:
sender
- The console sender
-
toPlainText
public java.lang.String toPlainText()
- Returns:
- Get the Fancy Message as just plain text
-
-