Record Class SelectorContents
java.lang.Object
java.lang.Record
net.minecraft.network.chat.contents.SelectorContents
- All Implemented Interfaces:
ComponentContents
public record SelectorContents(SelectorPattern selector, Optional<Component> separator)
extends Record
implements ComponentContents
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SelectorContents> private final SelectorPatternThe field for theselectorrecord component.The field for theseparatorrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSelectorContents(SelectorPattern selector, Optional<Component> separator) Creates an instance of aSelectorContentsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<SelectorContents> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.resolve(@Nullable CommandSourceStack source, @Nullable Entity entity, int recursionDepth) selector()Returns the value of theselectorrecord component.Returns the value of theseparatorrecord component.toString()Returns a string representation of this record class.<T> Optional<T> visit(FormattedText.ContentConsumer<T> output) <T> Optional<T> visit(FormattedText.StyledContentConsumer<T> output, Style currentStyle)
-
Field Details
-
selector
The field for theselectorrecord component. -
separator
-
MAP_CODEC
-
-
Constructor Details
-
SelectorContents
Creates an instance of aSelectorContentsrecord class.- Parameters:
selector- the value for theselectorrecord componentseparator- the value for theseparatorrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceComponentContents
-
resolve
public MutableComponent resolve(@Nullable CommandSourceStack source, @Nullable Entity entity, int recursionDepth) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
resolvein interfaceComponentContents- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
visit
- Specified by:
visitin interfaceComponentContents
-
visit
- Specified by:
visitin interfaceComponentContents
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
selector
Returns the value of theselectorrecord component.- Returns:
- the value of the
selectorrecord component
-
separator
-