Package xyz.srnyx.annoyingapi.options
Class MessagesOptions
java.lang.Object
xyz.srnyx.javautilities.parents.Stringable
xyz.srnyx.annoyingapi.options.MessagesOptions
public class MessagesOptions
extends xyz.srnyx.javautilities.parents.Stringable
Represents the options for the
AnnoyingPlugin.messages file-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class to hold the different defaultAnnoyingPlugin.messageskeys -
Field Summary
FieldsModifier and TypeFieldDescription@NotNull StringOPTIONALThe file name of the messages file (usuallymessages.yml)@NotNull MessagesOptions.MessageKeysOPTIONALThe different message keys for some default messages in themessages file -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull MessagesOptionsSetsfileName@NotNull MessagesOptionsfileOptions(@NotNull Consumer<AnnoyingResource.Options> consumer) SetsfileOptionsusing the specifiedConsumer@NotNull MessagesOptionsfileOptions(AnnoyingResource.Options fileOptions) SetsfileOptions@NotNull MessagesOptionskeys(@NotNull Consumer<MessagesOptions.MessageKeys> consumer) Setskeys@NotNull MessagesOptionskeys(@NotNull MessagesOptions.MessageKeys keys) Setskeysstatic @NotNull MessagesOptionsload(@NotNull org.bukkit.configuration.ConfigurationSection section) Loads the options from the specifiedConfigurationSectionMethods inherited from class xyz.srnyx.javautilities.parents.Stringable
toString, toString, toString, toString, toString
-
Field Details
-
fileName
OPTIONALThe file name of the messages file (usuallymessages.yml)If not specified, no messages will be loaded (plugin will still enable)
-
fileOptions
-
keys
OPTIONALThe different message keys for some default messages in themessages file
-
-
Constructor Details
-
MessagesOptions
public MessagesOptions()Constructs a newMessagesOptionsinstance with default values
-
-
Method Details
-
load
@NotNull public static @NotNull MessagesOptions load(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section) Loads the options from the specifiedConfigurationSection- Parameters:
section- the section to load the options from- Returns:
- the loaded options
-
fileName
SetsfileName- Parameters:
fileName- the newfileName- Returns:
- the
MessagesOptionsinstance for chaining
-
fileOptions
@NotNull public @NotNull MessagesOptions fileOptions(@Nullable AnnoyingResource.Options fileOptions) SetsfileOptions- Parameters:
fileOptions- the newfileOptions- Returns:
- the
MessagesOptionsinstance for chaining
-
fileOptions
@NotNull public @NotNull MessagesOptions fileOptions(@NotNull @NotNull Consumer<AnnoyingResource.Options> consumer) SetsfileOptionsusing the specifiedConsumer- Parameters:
consumer- the consumer to accept the newfileOptions- Returns:
- the
MessagesOptionsinstance for chaining
-
keys
Setskeys- Parameters:
keys- the newkeys- Returns:
- the
MessagesOptionsinstance for chaining
-
keys
@NotNull public @NotNull MessagesOptions keys(@NotNull @NotNull Consumer<MessagesOptions.MessageKeys> consumer) Setskeys- Parameters:
consumer- the consumer to accept the newkeys- Returns:
- the
MessagesOptionsinstance for chaining
-