Record Class Messages
java.lang.Object
java.lang.Record
dev.despical.pixelpainter.config.Messages
- Record Components:
templates- message keys mapped to MiniMessage templates
Loads Adventure MiniMessage templates and renders configured command output.
Bundled defaults fill absent keys; configured values must be strings with valid
strict MiniMessage syntax. The template map is copied before publication.
Templates use {name} placeholders: ordinary values are inserted as
literal text, while explicit Adventure components keep their formatting and
interactions. Players receive centered panels for keys that have a
-title companion; the console receives the same text unformatted.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidShows a message in a player's action bar; the console receives it as plain text.final booleanIndicates whether some other object is "equal to" this one.net.kyori.adventure.text.ComponentRenders a template with placeholders.booleanChecks whether a message exists.final inthashCode()Returns a hash code value for this object.static MessagesMerges the configured file with defaults and validates every template.voidpanel(org.bukkit.command.CommandSender sender, String key, net.kyori.adventure.text.Component action, Object... replacements) Renders a centered title and body with an optional action row.voidreply(org.bukkit.command.CommandSender sender, net.kyori.adventure.text.Component component) Delivers a component to a player, or unformatted non-empty lines to the console.voidSends a message, as a centered panel when it has a-titlecompanion.Returns the value of thetemplatesrecord component.Renders a template as plain text.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Messages
-
-
Method Details
-
load
-
get
Renders a template with placeholders.- Parameters:
key- message keyreplacements- alternating placeholder names and values; aComponentkeeps its interactions, any other value is inserted as literal text- Returns:
- rendered Adventure component
- Throws:
IllegalArgumentException- if the key is unknown or the pairs are incomplete
-
text
-
has
Checks whether a message exists.- Parameters:
key- message key- Returns:
- whether the template is defined
-
reply
public void reply(org.bukkit.command.CommandSender sender, net.kyori.adventure.text.Component component) Delivers a component to a player, or unformatted non-empty lines to the console.- Parameters:
sender- command audiencecomponent- rendered message
-
actionBar
-
send
-
panel
public void panel(org.bukkit.command.CommandSender sender, String key, net.kyori.adventure.text.Component action, Object... replacements) Renders a centered title and body with an optional action row.- Parameters:
sender- command audiencekey- message key whose-titlecompanion is the headingaction- optional action component;Component.empty()omits itreplacements- alternating placeholder names and values
-
toString
-
hashCode
-
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). -
templates
-