Package net.minestom.server.adventure
Interface ComponentHolder<T>
- Type Parameters:
T
- the holding class
- All Known Subinterfaces:
RecipeDisplay
,ServerPacket.ComponentHolding
,SlotDisplay
- 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
,RecipeBookAddPacket
,RecipeDisplay.CraftingShaped
,RecipeDisplay.CraftingShapeless
,RecipeDisplay.Furnace
,RecipeDisplay.Smithing
,RecipeDisplay.Stonecutter
,ResourcePackPushPacket
,ScoreboardObjectivePacket
,SetCursorItemPacket
,SetPlayerInventorySlotPacket
,SetSlotPacket
,SetTitleSubTitlePacket
,SetTitleTextPacket
,SlotDisplay.AnyFuel
,SlotDisplay.Composite
,SlotDisplay.Empty
,SlotDisplay.Item
,SlotDisplay.ItemStack
,SlotDisplay.SmithingTrim
,SlotDisplay.Tag
,SlotDisplay.WithRemainder
,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 TypeMethodDescription@NotNull Collection
<Component> Gets the components held by this object.copyWithOperator
(@NotNull UnaryOperator<Component> operator) Returns a copy of this object.default void
visitComponents
(@NotNull Consumer<Component> visitor) Visits each component held by this object.
-
Method Details
-
components
Gets the components held by this object.- Returns:
- the components
-
copyWithOperator
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
Visits each component held by this object.- Parameters:
visitor
- the visitor
-