Package net.jeqo.bloons.message
Record Class MessageTranslations
java.lang.Object
java.lang.Record
net.jeqo.bloons.message.MessageTranslations
- Record Components:
instance
- The instance of the plugin, type org.bukkit.plugin.java.JavaPlugin
A utility class intended to get messages from the config.yml file
-
Constructor Summary
ConstructorsConstructorDescriptionMessageTranslations
(org.bukkit.plugin.java.JavaPlugin instance) Creates an instance of aMessageTranslations
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Get an integer from the config.yml filenet.kyori.adventure.text.Component
getSerializedString
(String message) Converts a message containing MiniMessage serialized strings to a Component that can be used to send formatted messages with gradients, rainbows, etc.net.kyori.adventure.text.Component
getSerializedString
(String messagePrefix, String messageSuffix) Converts a message containing MiniMessage serialized strings to a Component that can be used to send formatted messages with gradients, rainbows, etc.Get a string from the config.yml filefinal int
hashCode()
Returns a hash code value for this object.org.bukkit.plugin.java.JavaPlugin
instance()
Returns the value of theinstance
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
MessageTranslations
public MessageTranslations(org.bukkit.plugin.java.JavaPlugin instance) Creates an instance of aMessageTranslations
record class.- Parameters:
instance
- the value for theinstance
record component
-
-
Method Details
-
getSerializedString
public net.kyori.adventure.text.Component getSerializedString(String messagePrefix, String messageSuffix) Converts a message containing MiniMessage serialized strings to a Component that can be used to send formatted messages with gradients, rainbows, etc.- Parameters:
messagePrefix
- The prefix of the message, type java.lang.StringmessageSuffix
- The suffix of the message, type java.lang.String- Returns:
- The formatted message as a Component, type net.kyori.adventure.text.Component
-
getSerializedString
Converts a message containing MiniMessage serialized strings to a Component that can be used to send formatted messages with gradients, rainbows, etc.- Parameters:
message
- The message to convert to a deserialized component, type java.lang.String- Returns:
- The formatted message as a Component, type net.kyori.adventure.text.Component
-
getString
Get a string from the config.yml file- Parameters:
path
- The path to the string, type java.lang.String- Returns:
- The value at the specified path, type java.lang.String
-
getInt
Get an integer from the config.yml file- Parameters:
path
- The path to the integer, type java.lang.String- Returns:
- The value at the specified path, type java.lang.Integer
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
instance
public org.bukkit.plugin.java.JavaPlugin instance()Returns the value of theinstance
record component.- Returns:
- the value of the
instance
record component
-