Record Class NbtContents
java.lang.Object
java.lang.Record
net.minecraft.network.chat.contents.NbtContents
- All Implemented Interfaces:
ComponentContents
public record NbtContents(CompilableString<NbtPathArgument.NbtPath> nbtPath, boolean interpreting, boolean plain, Optional<Component> separator, DataSource dataSource)
extends Record
implements ComponentContents
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DataSourceThe field for thedataSourcerecord component.private final booleanThe field for theinterpretingrecord component.private static final org.slf4j.Loggerstatic final MapCodec<NbtContents> static final Codec<CompilableString<NbtPathArgument.NbtPath>> private final CompilableString<NbtPathArgument.NbtPath> The field for thenbtPathrecord component.private final booleanThe field for theplainrecord component.The field for theseparatorrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionNbtContents(CompilableString<NbtPathArgument.NbtPath> nbtPath, boolean interpreting, boolean plain, Optional<Component> separator, DataSource dataSource) Creates an instance of aNbtContentsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()Returns the value of thedataSourcerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinterpretingrecord component.nbtPath()Returns the value of thenbtPathrecord component.booleanplain()Returns the value of theplainrecord component.resolve(ResolutionContext context, int recursionDepth) Returns the value of theseparatorrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface ComponentContents
visit, visit
-
Field Details
-
nbtPath
The field for thenbtPathrecord component. -
interpreting
private final boolean interpretingThe field for theinterpretingrecord component. -
plain
private final boolean plainThe field for theplainrecord component. -
separator
-
dataSource
The field for thedataSourcerecord component. -
LOGGER
private static final org.slf4j.Logger LOGGER -
NBT_PATH_CODEC
-
MAP_CODEC
-
-
Constructor Details
-
NbtContents
public NbtContents(CompilableString<NbtPathArgument.NbtPath> nbtPath, boolean interpreting, boolean plain, Optional<Component> separator, DataSource dataSource) Creates an instance of aNbtContentsrecord class.- Parameters:
nbtPath- the value for thenbtPathrecord componentinterpreting- the value for theinterpretingrecord componentplain- the value for theplainrecord componentseparator- the value for theseparatorrecord componentdataSource- the value for thedataSourcerecord component
-
-
Method Details
-
resolve
public MutableComponent resolve(ResolutionContext context, int recursionDepth) throws CommandSyntaxException - Specified by:
resolvein interfaceComponentContents- Throws:
CommandSyntaxException
-
codec
- Specified by:
codecin 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
nbtPath
Returns the value of thenbtPathrecord component.- Returns:
- the value of the
nbtPathrecord component
-
interpreting
public boolean interpreting()Returns the value of theinterpretingrecord component.- Returns:
- the value of the
interpretingrecord component
-
plain
public boolean plain()Returns the value of theplainrecord component.- Returns:
- the value of the
plainrecord component
-
separator
-
dataSource
Returns the value of thedataSourcerecord component.- Returns:
- the value of the
dataSourcerecord component
-