Record Class InsertingContents
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.util.InsertingContents
- All Implemented Interfaces:
ComponentContents
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theindexrecord component.static final com.mojang.serialization.MapCodec<InsertingContents> private static final ThreadLocal<Deque<TranslatableContents>> -
Constructor Summary
ConstructorsConstructorDescriptionInsertingContents(int index) Creates an instance of aInsertingContentsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<InsertingContents> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.static voidstatic booleanpushTranslation(TranslatableContents contents) final StringtoString()Returns a string representation of this record class.<T> Optional<T> visit(FormattedText.ContentConsumer<T> visitor) <T> Optional<T> visit(FormattedText.StyledContentConsumer<T> visitor, Style style) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.chat.ComponentContents
resolve
-
Field Details
-
index
private final int indexThe field for theindexrecord component. -
MAP_CODEC
-
TRANSLATION_STACK
-
-
Constructor Details
-
InsertingContents
public InsertingContents(int index) Creates an instance of aInsertingContentsrecord class.- Parameters:
index- the value for theindexrecord component
-
-
Method Details
-
pushTranslation
-
popTranslation
@Internal public static void popTranslation() -
visit
- Specified by:
visitin interfaceComponentContents
-
visit
- Specified by:
visitin interfaceComponentContents
-
codec
- Specified by:
codecin interfaceComponentContents
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 with '=='. -
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-