Record Class SimpleResearch
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.SimpleResearch
- All Implemented Interfaces:
RegistryDisplay<Research>,Research
public record SimpleResearch(ItemResearchIcon researchIcon, ResearchMethod researchMethod, ResearchEffect researchEffect, List<net.minecraft.resources.ResourceKey<Research>> parents, boolean requiresParent, DisplayImpl display)
extends Record
implements Research, RegistryDisplay<Research>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields inherited from interface com.portingdeadmods.researchd.api.research.Research
CODEC, RESOURCE_KEY_CODEC, RESOURCE_KEY_STREAM_CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSimpleResearch(ItemResearchIcon researchIcon, ResearchMethod researchMethod, ResearchEffect researchEffect, List<net.minecraft.resources.ResourceKey<Research>> parents, boolean requiresParent, DisplayImpl display) Creates an instance of aSimpleResearchrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleResearch.Builderbuilder()display()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.network.chat.ComponentgetDisplayDescription(net.minecraft.resources.ResourceKey<Research> key) net.minecraft.network.chat.ComponentgetDisplayName(net.minecraft.resources.ResourceKey<Research> key) final inthashCode()Returns a hash code value for this object.parents()Returns the value of theparentsrecord component.booleanReturns the value of therequiresParentrecord component.Returns the value of theresearchEffectrecord component.Returns the value of theresearchIconrecord component.Returns the value of theresearchMethodrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.portingdeadmods.researchd.api.research.RegistryDisplay
getDisplayDescriptionUnsafe, getDisplayNameUnsafe
-
Constructor Details
-
SimpleResearch
public SimpleResearch(ItemResearchIcon researchIcon, ResearchMethod researchMethod, ResearchEffect researchEffect, List<net.minecraft.resources.ResourceKey<Research>> parents, boolean requiresParent, DisplayImpl display) Creates an instance of aSimpleResearchrecord class.- Parameters:
researchIcon- the value for theresearchIconrecord componentresearchMethod- the value for theresearchMethodrecord componentresearchEffect- the value for theresearchEffectrecord componentparents- the value for theparentsrecord componentrequiresParent- the value for therequiresParentrecord componentdisplay- the value for thedisplayrecord component
-
-
Method Details
-
getSerializer
- Specified by:
getSerializerin interfaceResearch- Returns:
- serializer providing typed codecs for the Research
-
builder
-
getDisplayName
public net.minecraft.network.chat.Component getDisplayName(net.minecraft.resources.ResourceKey<Research> key) - Specified by:
getDisplayNamein interfaceRegistryDisplay<Research>
-
getDisplayDescription
public net.minecraft.network.chat.Component getDisplayDescription(net.minecraft.resources.ResourceKey<Research> key) - Specified by:
getDisplayDescriptionin interfaceRegistryDisplay<Research>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
researchIcon
Returns the value of theresearchIconrecord component.- Specified by:
researchIconin interfaceResearch- Returns:
- the value of the
researchIconrecord component
-
researchMethod
Returns the value of theresearchMethodrecord component.- Specified by:
researchMethodin interfaceResearch- Returns:
- the value of the
researchMethodrecord component
-
researchEffect
Returns the value of theresearchEffectrecord component.- Specified by:
researchEffectin interfaceResearch- Returns:
- the value of the
researchEffectrecord component
-
parents
Returns the value of theparentsrecord component. -
requiresParent
public boolean requiresParent()Returns the value of therequiresParentrecord component.- Specified by:
requiresParentin interfaceResearch- Returns:
- the value of the
requiresParentrecord component
-
display
Returns the value of thedisplayrecord component.- Returns:
- the value of the
displayrecord component
-