Klasse Messages
java.lang.Object
de.delinkedde.mobarenareborn.config.Messages
Renders user-facing chat messages from the configuration.
Message strings are read from the messages.* section of config.yml and
parsed as Adventure MiniMessage. Values are read lazily on every call, so a configuration
reload performed through ConfigManager.reload() takes effect immediately without
any cache invalidation.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungMessages(@NotNull ConfigManager config) Creates a message renderer backed by the given configuration manager. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungnet.kyori.adventure.text.ComponentReturns a prefixed, parsed message resolved viatext(String, String, String...).@NotNull net.kyori.adventure.text.ComponentReturns a prefixed message component for the given key.@NotNull net.kyori.adventure.text.Componentprefix()Returns the configured message prefix as a component.@NotNull net.kyori.adventure.text.ComponentReturns a parsed message component for the given key, without the prefix.@NotNull StringResolves a message string: the configured value undermessages.<key>when present, otherwise the given default.
-
Konstruktordetails
-
Messages
Creates a message renderer backed by the given configuration manager.- Parameter:
config- the configuration manager to read message strings from
-
-
Methodendetails
-
prefix
@NotNull public @NotNull net.kyori.adventure.text.Component prefix()Returns the configured message prefix as a component.- Gibt zurück:
- the parsed prefix component
-
message
Returns a prefixed message component for the given key.- Parameter:
key- the message key relative to themessagessection, for example"reloaded"- Gibt zurück:
- the prefix followed by the parsed message; a visible placeholder is returned when the key is missing
-
text
@NotNull public @NotNull String text(@NotNull @NotNull String key, @NotNull @NotNull String def, @NotNull @NotNull String... replacements) Resolves a message string: the configured value undermessages.<key>when present, otherwise the given default. Placeholder pairs are applied afterwards ("<player>", name, "<count>", "3").- Parameter:
key- the message key relative to themessagessectiondef- the built-in default (MiniMessage)replacements- placeholder/value pairs applied to the resolved string- Gibt zurück:
- the resolved MiniMessage string
-
line
@NotNull public net.kyori.adventure.text.Component line(@NotNull @NotNull String key, @NotNull @NotNull String def, @NotNull @NotNull String... replacements) Returns a prefixed, parsed message resolved viatext(String, String, String...).- Parameter:
key- the message key relative to themessagessectiondef- the built-in default (MiniMessage)replacements- placeholder/value pairs- Gibt zurück:
- the prefix followed by the parsed message
-
raw
Returns a parsed message component for the given key, without the prefix.- Parameter:
key- the message key relative to themessagessection- Gibt zurück:
- the parsed message; a visible placeholder is returned when the key is missing
-