Record Class ResearchPack

java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.api.research.packs.ResearchPack

public record ResearchPack(int color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture) extends Record
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<ResearchPack>
     
    static final ResearchPack
     
    static 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

    Constructors
    Constructor
    Description
    ResearchPack(int color, int sortingValue, Optional<net.minecraft.resources.ResourceLocation> customTexture)
    Creates an instance of a ResearchPack record 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 Type
    Method
    Description
    static net.minecraft.world.item.ItemStack
    asStack(net.minecraft.resources.ResourceKey<ResearchPack> key)
     
     
    int
    Returns the value of the color record component.
    com.portingdeadmods.portingdeadlibs.api.utils.RGBAColor
     
    Optional<net.minecraft.resources.ResourceLocation>
    Returns the value of the customTexture record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the sortingValue record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<ResearchPack> 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

      public static final ResearchPack 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 a ResearchPack record class.
      Parameters:
      color - the value for the color record component
      sortingValue - the value for the sortingValue record component
      customTexture - the value for the customTexture record 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

      public static ResearchPack.Builder builder()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • color

      public int color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • sortingValue

      public int sortingValue()
      Returns the value of the sortingValue record component.
      Returns:
      the value of the sortingValue record component
    • customTexture

      public Optional<net.minecraft.resources.ResourceLocation> customTexture()
      Returns the value of the customTexture record component.
      Returns:
      the value of the customTexture record component