Record Class PlainMessage
java.lang.Object
java.lang.Record
net.minecraft.server.dialog.body.PlainMessage
- All Implemented Interfaces:
DialogBody
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PlainMessage> private final ComponentThe field for thecontentsrecord component.static final intstatic final com.mojang.serialization.MapCodec<PlainMessage> private final intThe field for thewidthrecord component.Fields inherited from interface DialogBody
COMPACT_LIST_CODEC, DIALOG_BODY_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionPlainMessage(Component contents, int width) Creates an instance of aPlainMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontents()Returns the value of thecontentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.com.mojang.serialization.MapCodec<PlainMessage> mapCodec()final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Field Details
-
contents
The field for thecontentsrecord component. -
width
private final int widthThe field for thewidthrecord component. -
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH- See Also:
-
MAP_CODEC
-
CODEC
-
-
Constructor Details
-
PlainMessage
Creates an instance of aPlainMessagerecord class.- Parameters:
contents- the value for thecontentsrecord componentwidth- the value for thewidthrecord component
-
-
Method Details
-
mapCodec
- Specified by:
mapCodecin interfaceDialogBody
-
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. -
contents
Returns the value of thecontentsrecord component.- Returns:
- the value of the
contentsrecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-