Package xyz.srnyx.annoyingapi.options
Class RegistrationOptions
java.lang.Object
xyz.srnyx.javautilities.parents.Stringable
xyz.srnyx.annoyingapi.options.RegistrationOptions
public class RegistrationOptions
extends xyz.srnyx.javautilities.parents.Stringable
Represents the options for class registration (commands/listeners/etc...)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe automatic registration optionsstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionTheRegistrationOptions.AutomaticRegistrationoptions to automatically registerRegistrables@NotNull RegistrationOptions.Selectors@NotNull Set<Registrable> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull RegistrationOptionsautomaticRegistration(@NotNull Consumer<RegistrationOptions.AutomaticRegistration> automaticRegistration) Sets theautomaticRegistrationusing the specifiedConsumer@NotNull RegistrationOptionsautomaticRegistration(@NotNull RegistrationOptions.AutomaticRegistration automaticRegistration) Sets theautomaticRegistration@NotNull Optional<me.clip.placeholderapi.expansion.PlaceholderExpansion> Casts thepapiExpansionToRegisterto aPlaceholderExpansionand returns itstatic @NotNull RegistrationOptionsload(@NotNull org.bukkit.configuration.ConfigurationSection section) Loads the options from the specifiedConfigurationSection@NotNull RegistrationOptionspapiExpansionToRegister(@NotNull Supplier<Object> papiExpansionToRegister) Sets thepapiExpansionToRegister@NotNull RegistrationOptionstoRegister(@NotNull Collection<Registrable> toRegister) Adds the specifiedRegistrables totoRegisterfinal @NotNull RegistrationOptionstoRegister(@NotNull AnnoyingPlugin plugin, @NotNull Class<? extends Registrable>... toRegister) Adds the specifiedRegistrables totoRegister@NotNull RegistrationOptionstoRegister(@NotNull AnnoyingPlugin plugin, @NotNull Collection<Class<? extends Registrable>> toRegister) Adds the specifiedRegistrables totoRegister@NotNull RegistrationOptionstoRegister(@NotNull Registrable... toRegister) Adds the specifiedRegistrables totoRegisterMethods inherited from class xyz.srnyx.javautilities.parents.Stringable
toString, toString, toString, toString, toString
-
Field Details
-
automaticRegistration
TheRegistrationOptions.AutomaticRegistrationoptions to automatically registerRegistrables -
selectors
-
toRegister
-
papiExpansionToRegister
-
-
Constructor Details
-
RegistrationOptions
public RegistrationOptions()Constructs a newRegistrationOptionsinstance with default values
-
-
Method Details
-
load
@NotNull public static @NotNull RegistrationOptions 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
-
getPapiExpansionToRegister
@NotNull public @NotNull Optional<me.clip.placeholderapi.expansion.PlaceholderExpansion> getPapiExpansionToRegister()Casts thepapiExpansionToRegisterto aPlaceholderExpansionand returns it- Returns:
- the
papiExpansionToRegisteras aPlaceholderExpansionor empty if it isn't
-
automaticRegistration
@NotNull public @NotNull RegistrationOptions automaticRegistration(@NotNull @NotNull RegistrationOptions.AutomaticRegistration automaticRegistration) Sets theautomaticRegistration- Parameters:
automaticRegistration- the automatic registration- Returns:
- this
RegistrationOptionsinstance for chaining
-
automaticRegistration
@NotNull public @NotNull RegistrationOptions automaticRegistration(@NotNull @NotNull Consumer<RegistrationOptions.AutomaticRegistration> automaticRegistration) Sets theautomaticRegistrationusing the specifiedConsumer- Parameters:
automaticRegistration- the automatic registration- Returns:
- this
RegistrationOptionsinstance for chaining
-
toRegister
@NotNull public @NotNull RegistrationOptions toRegister(@NotNull @NotNull Collection<Registrable> toRegister) Adds the specifiedRegistrables totoRegister- Parameters:
toRegister- theRegistrables to add- Returns:
- this
RegistrationOptionsinstance for chaining
-
toRegister
@NotNull public @NotNull RegistrationOptions toRegister(@NotNull @NotNull Registrable... toRegister) Adds the specifiedRegistrables totoRegister- Parameters:
toRegister- theRegistrables to add- Returns:
- this
RegistrationOptionsinstance for chaining
-
toRegister
@NotNull public @NotNull RegistrationOptions toRegister(@NotNull @NotNull AnnoyingPlugin plugin, @NotNull @NotNull Collection<Class<? extends Registrable>> toRegister) Adds the specifiedRegistrables totoRegister- Parameters:
plugin- the plugin instancetoRegister- theRegistrables to add- Returns:
- this
RegistrationOptionsinstance for chaining
-
toRegister
@NotNull @SafeVarargs public final @NotNull RegistrationOptions toRegister(@NotNull @NotNull AnnoyingPlugin plugin, @NotNull @NotNull Class<? extends Registrable>... toRegister) Adds the specifiedRegistrables totoRegister- Parameters:
plugin- the plugin instancetoRegister- theRegistrables to add- Returns:
- this
RegistrationOptionsinstance for chaining
-
papiExpansionToRegister
@NotNull public @NotNull RegistrationOptions papiExpansionToRegister(@NotNull @NotNull Supplier<Object> papiExpansionToRegister) Sets thepapiExpansionToRegister- Parameters:
papiExpansionToRegister- the PAPI expansion to register- Returns:
- this
RegistrationOptionsinstance for chaining
-