Record Class ResearchPackImpl
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.ResearchPackImpl
- All Implemented Interfaces:
ResearchPack,RegistryDisplay<ResearchPack>
public record ResearchPackImpl(int color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture, DisplayImpl display)
extends Record
implements ResearchPack, RegistryDisplay<ResearchPack>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Field Summary
FieldsFields inherited from interface com.portingdeadmods.researchd.api.research.packs.ResearchPack
CODEC, RESOURCE_KEY_CODEC, RESOURCE_KEY_STREAM_CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionResearchPackImpl(int color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture, DisplayImpl display) Creates an instance of aResearchPackImplrecord class.ResearchPackImpl(com.portingdeadmods.portingdeadlibs.api.utils.RGBAColor color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture, DisplayImpl display) ResearchPackImpl(net.minecraft.resources.ResourceLocation customTexture) -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.item.ItemStackasStack(net.minecraft.resources.ResourceKey<ResearchPack> key) static ResearchPackImpl.Builderbuilder()intcolor()Returns the value of thecolorrecord component.com.portingdeadmods.portingdeadlibs.api.utils.RGBAColorOptional<net.minecraft.resources.ResourceLocation> Returns the value of thecustomTexturerecord component.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<ResearchPack> key) net.minecraft.network.chat.ComponentgetDisplayName(net.minecraft.resources.ResourceKey<ResearchPack> key) final inthashCode()Returns a hash code value for this object.intReturns the value of thesortingValuerecord 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
-
Field Details
-
EMPTY
-
-
Constructor Details
-
ResearchPackImpl
public ResearchPackImpl(net.minecraft.resources.ResourceLocation customTexture) -
ResearchPackImpl
public ResearchPackImpl(com.portingdeadmods.portingdeadlibs.api.utils.RGBAColor color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture, DisplayImpl display) -
ResearchPackImpl
public ResearchPackImpl(int color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture, DisplayImpl display) Creates an instance of aResearchPackImplrecord class.- Parameters:
color- the value for thecolorrecord componentsortingValue- the value for thesortingValuerecord componentcustomTexture- the value for thecustomTexturerecord componentdisplay- the value for thedisplayrecord component
-
-
Method Details
-
colorAsRgba
public com.portingdeadmods.portingdeadlibs.api.utils.RGBAColor colorAsRgba() -
asStack
public static net.minecraft.world.item.ItemStack asStack(net.minecraft.resources.ResourceKey<ResearchPack> key) -
builder
-
getDisplayName
public net.minecraft.network.chat.Component getDisplayName(net.minecraft.resources.ResourceKey<ResearchPack> key) - Specified by:
getDisplayNamein interfaceRegistryDisplay<ResearchPack>
-
getDisplayDescription
public net.minecraft.network.chat.Component getDisplayDescription(net.minecraft.resources.ResourceKey<ResearchPack> key) - Specified by:
getDisplayDescriptionin interfaceRegistryDisplay<ResearchPack>
-
getSerializer
- Specified by:
getSerializerin interfaceResearchPack
-
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 '=='. -
color
public int color()Returns the value of thecolorrecord component.- Specified by:
colorin interfaceResearchPack- Returns:
- the value of the
colorrecord component
-
sortingValue
public int sortingValue()Returns the value of thesortingValuerecord component.- Specified by:
sortingValuein interfaceResearchPack- Returns:
- the value of the
sortingValuerecord component
-
customTexture
Returns the value of thecustomTexturerecord component.- Specified by:
customTexturein interfaceResearchPack- Returns:
- the value of the
customTexturerecord component
-
display
Returns the value of thedisplayrecord component.- Returns:
- the value of the
displayrecord component
-