Record Class ResearchPack
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.api.research.packs.ResearchPack
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ResearchPack> static final ResearchPackstatic final com.mojang.serialization.Codec<net.minecraft.resources.ResourceKey<ResearchPack>> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, net.minecraft.resources.ResourceKey<ResearchPack>> static final net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, ResearchPack> -
Constructor Summary
ConstructorsConstructorDescriptionResearchPack(int color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture) Creates an instance of aResearchPackrecord class.ResearchPack(com.portingdeadmods.portingdeadlibs.api.utils.RGBAColor color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture) ResearchPack(net.minecraft.resources.ResourceLocation customTexture) -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.item.ItemStackasStack(net.minecraft.resources.ResourceKey<ResearchPack> key) static ResearchPack.Builderbuilder()intcolor()Returns the value of thecolorrecord component.com.portingdeadmods.portingdeadlibs.api.utils.RGBAColorOptional<net.minecraft.resources.ResourceLocation> Returns the value of thecustomTexturerecord component.final booleanIndicates whether some other object is "equal to" this one.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.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,ResearchPack> STREAM_CODEC -
RESOURCE_KEY_CODEC
public static final com.mojang.serialization.Codec<net.minecraft.resources.ResourceKey<ResearchPack>> RESOURCE_KEY_CODEC -
RESOURCE_KEY_STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,net.minecraft.resources.ResourceKey<ResearchPack>> RESOURCE_KEY_STREAM_CODEC -
EMPTY
-
-
Constructor Details
-
ResearchPack
public ResearchPack(net.minecraft.resources.ResourceLocation customTexture) -
ResearchPack
public ResearchPack(com.portingdeadmods.portingdeadlibs.api.utils.RGBAColor color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture) -
ResearchPack
public ResearchPack(int color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture) Creates an instance of aResearchPackrecord class.- Parameters:
color- the value for thecolorrecord componentsortingValue- the value for thesortingValuerecord componentcustomTexture- the value for thecustomTexturerecord 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
-
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.- Returns:
- the value of the
colorrecord component
-
sortingValue
public int sortingValue()Returns the value of thesortingValuerecord component.- Returns:
- the value of the
sortingValuerecord component
-
customTexture
Returns the value of thecustomTexturerecord component.- Returns:
- the value of the
customTexturerecord component
-