Record Class SelectorContents
java.lang.Object
java.lang.Record
net.minecraft.network.chat.contents.SelectorContents
- All Implemented Interfaces:
ComponentContents
public record SelectorContents(CompilableString<EntitySelector> selector, Optional<Component> separator)
extends Record
implements ComponentContents
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MapCodec<SelectorContents> private final CompilableString<EntitySelector> The field for theselectorrecord component.The field for theseparatorrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSelectorContents(CompilableString<EntitySelector> selector, Optional<Component> separator) Creates an instance of aSelectorContentsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.resolve(ResolutionContext context, 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(ResolutionContext context, int recursionDepth) throws CommandSyntaxException - Specified by:
resolvein interfaceComponentContents- Throws:
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
-