Record Class TextResearchIcon
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.icons.TextResearchIcon
- All Implemented Interfaces:
ResearchIcon
public record TextResearchIcon(net.minecraft.network.chat.Component text)
extends Record
implements ResearchIcon
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TextResearchIconstatic final net.minecraft.resources.ResourceLocationstatic final ResearchIconSerializer<TextResearchIcon> Fields inherited from interface com.portingdeadmods.researchd.api.research.ResearchIcon
CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionTextResearchIcon(net.minecraft.network.chat.Component text) Creates an instance of aTextResearchIconrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationid()net.minecraft.network.chat.Componenttext()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
SERIALIZER
-
ID
public static final net.minecraft.resources.ResourceLocation ID -
EMPTY
-
-
Constructor Details
-
TextResearchIcon
public TextResearchIcon(net.minecraft.network.chat.Component text) Creates an instance of aTextResearchIconrecord class.- Parameters:
text- the value for thetextrecord component
-
-
Method Details
-
id
public net.minecraft.resources.ResourceLocation id()- Specified by:
idin interfaceResearchIcon- Returns:
- The id of this type of Research Icon. Usually this is just a constant in the Research Icon class
-
getSerializer
- Specified by:
getSerializerin interfaceResearchIcon
-
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 withObjects::equals(Object,Object). -
text
public net.minecraft.network.chat.Component text()Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-