Interface ComponentHolder<T>

Type Parameters:
T - the holding class
All Known Subinterfaces:
ComponentHoldingServerPacket
All Known Implementing Classes:
ActionBarPacket, AdvancementsPacket, AdvancementsPacket.Advancement, AdvancementsPacket.AdvancementMapping, AdvancementsPacket.DisplayData, BossBarPacket, BossBarPacket.AddAction, BossBarPacket.UpdateTitleAction, DeathCombatEventPacket, DisconnectPacket, EntityEquipmentPacket, EntityMetaDataPacket, LoginDisconnectPacket, OpenWindowPacket, PlayerChatMessagePacket, PlayerListHeaderAndFooterPacket, ResourcePackSendPacket, ScoreboardObjectivePacket, SetSlotPacket, SetTitleSubTitlePacket, SetTitleTextPacket, SystemChatPacket, TabCompletePacket, TabCompletePacket.Match, TeamsPacket, TeamsPacket.CreateTeamAction, TeamsPacket.UpdateTeamAction, WindowItemsPacket

public interface ComponentHolder<T>
Represents an object that holds some amount of components.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Collection<net.kyori.adventure.text.Component>
    Gets the components held by this object.
    copyWithOperator(@NotNull UnaryOperator<net.kyori.adventure.text.Component> operator)
    Returns a copy of this object.
    default void
    visitComponents(@NotNull Consumer<net.kyori.adventure.text.Component> visitor)
    Visits each component held by this object.
  • Method Details

    • components

      @NotNull @NotNull Collection<net.kyori.adventure.text.Component> components()
      Gets the components held by this object.
      Returns:
      the components
    • copyWithOperator

      @NotNull T copyWithOperator(@NotNull @NotNull UnaryOperator<net.kyori.adventure.text.Component> operator)
      Returns a copy of this object. For each component this object holds, the operator is applied to the copy before returning.
      Parameters:
      operator - the operator
      Returns:
      the copy
    • visitComponents

      default void visitComponents(@NotNull @NotNull Consumer<net.kyori.adventure.text.Component> visitor)
      Visits each component held by this object.
      Parameters:
      visitor - the visitor