Interface MutableStyleSetter<T extends MutableStyleSetter<?>>

Type Parameters:
T - The type implementing this interface e.g. Component
All Superinterfaces:
StyleSetter<T>
All Known Subinterfaces:
BlockNBTComponent.Builder, ComponentBuilder<C,B>, EntityNBTComponent.Builder, KeybindComponent.Builder, NBTComponentBuilder<C,B>, ScoreComponent.Builder, SelectorComponent.Builder, StorageNBTComponent.Builder, Style.Builder, TextComponent.Builder, TranslatableComponent.Builder

@NonExtendable public interface MutableStyleSetter<T extends MutableStyleSetter<?>> extends StyleSetter<T>
Writes style properties to a mutable object. Used to override some default methods from StyleSetter with faster alternatives that only work for mutable objects.
Since:
4.10.0
See Also:
  • Method Details

    • decorate

      @Contract("_ -> this") @NotNull default T decorate(@NotNull @NotNull TextDecoration @NotNull ... decorations)
      Sets decorations to TextDecoration.State.TRUE.
      Specified by:
      decorate in interface StyleSetter<T extends MutableStyleSetter<?>>
      Parameters:
      decorations - the decorations
      Returns:
      a mutable object (T)
      Since:
      4.10.0
    • decorations

      @Contract("_ -> this") @NotNull default T decorations(@NotNull @NotNull Map<TextDecoration,TextDecoration.State> decorations)
      Sets decorations using the specified decorations map.

      If a given decoration does not have a value explicitly set, the value of that particular decoration is not changed.

      Specified by:
      decorations in interface StyleSetter<T extends MutableStyleSetter<?>>
      Parameters:
      decorations - a map containing text decorations and their respective state.
      Returns:
      a mutable object (T)
      Since:
      4.10.0
    • decorations

      @Contract("_, _ -> this") @NotNull default T decorations(@NotNull @NotNull Set<TextDecoration> decorations, boolean flag)
      Sets the state of a set of decorations to flag.
      Specified by:
      decorations in interface StyleSetter<T extends MutableStyleSetter<?>>
      Parameters:
      decorations - the decorations
      flag - true if this mutable object should have the decorations, false if this mutable object should not have the decorations
      Returns:
      a mutable object (T)
      Since:
      4.10.0