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>
  • Field Details

  • 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 a ResearchPackImpl 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
      display - the value for the display 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 ResearchPackImpl.Builder builder()
    • getDisplayName

      public net.minecraft.network.chat.Component getDisplayName(net.minecraft.resources.ResourceKey<ResearchPack> key)
      Specified by:
      getDisplayName in interface RegistryDisplay<ResearchPack>
    • getDisplayDescription

      public net.minecraft.network.chat.Component getDisplayDescription(net.minecraft.resources.ResourceKey<ResearchPack> key)
      Specified by:
      getDisplayDescription in interface RegistryDisplay<ResearchPack>
    • getSerializer

      public ResearchPackSerializer<?> getSerializer()
      Specified by:
      getSerializer in interface ResearchPack
    • 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.
      Specified by:
      color in interface ResearchPack
      Returns:
      the value of the color record component
    • sortingValue

      public int sortingValue()
      Returns the value of the sortingValue record component.
      Specified by:
      sortingValue in interface ResearchPack
      Returns:
      the value of the sortingValue record component
    • customTexture

      public Optional<net.minecraft.resources.ResourceLocation> customTexture()
      Returns the value of the customTexture record component.
      Specified by:
      customTexture in interface ResearchPack
      Returns:
      the value of the customTexture record component
    • display

      public DisplayImpl display()
      Returns the value of the display record component.
      Returns:
      the value of the display record component