Record Class ResearchPackComponent
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.data.components.ResearchPackComponent
public record ResearchPackComponent(Optional<net.minecraft.resources.ResourceKey<ResearchPack>> researchPackKey)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ResearchPackComponent> static final ResearchPackComponentstatic final net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, ResearchPackComponent> -
Constructor Summary
ConstructorsConstructorDescriptionResearchPackComponent(Optional<net.minecraft.resources.ResourceKey<ResearchPack>> researchPackKey) Creates an instance of aResearchPackComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.Optional<net.minecraft.resources.ResourceKey<ResearchPack>> Returns the value of theresearchPackKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,ResearchPackComponent> STREAM_CODEC
-
-
Constructor Details
-
ResearchPackComponent
public ResearchPackComponent(Optional<net.minecraft.resources.ResourceKey<ResearchPack>> researchPackKey) Creates an instance of aResearchPackComponentrecord class.- Parameters:
researchPackKey- the value for theresearchPackKeyrecord component
-
-
Method Details
-
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). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
researchPackKey
Returns the value of theresearchPackKeyrecord component.- Returns:
- the value of the
researchPackKeyrecord component
-