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>
  • 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 a SimpleResearch record class.
      Parameters:
      researchIcon - the value for the researchIcon record component
      researchMethod - the value for the researchMethod record component
      researchEffect - the value for the researchEffect record component
      parents - the value for the parents record component
      requiresParent - the value for the requiresParent record component
      display - the value for the display record component
  • Method Details

    • getSerializer

      public ResearchSerializer<?> getSerializer()
      Specified by:
      getSerializer in interface Research
      Returns:
      serializer providing typed codecs for the Research
    • builder

      public static SimpleResearch.Builder builder()
    • getDisplayName

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

      public net.minecraft.network.chat.Component getDisplayDescription(net.minecraft.resources.ResourceKey<Research> key)
      Specified by:
      getDisplayDescription in interface RegistryDisplay<Research>
    • 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.
    • researchIcon

      public ItemResearchIcon researchIcon()
      Returns the value of the researchIcon record component.
      Specified by:
      researchIcon in interface Research
      Returns:
      the value of the researchIcon record component
    • researchMethod

      public ResearchMethod researchMethod()
      Returns the value of the researchMethod record component.
      Specified by:
      researchMethod in interface Research
      Returns:
      the value of the researchMethod record component
    • researchEffect

      public ResearchEffect researchEffect()
      Returns the value of the researchEffect record component.
      Specified by:
      researchEffect in interface Research
      Returns:
      the value of the researchEffect record component
    • parents

      public List<net.minecraft.resources.ResourceKey<Research>> parents()
      Returns the value of the parents record component.
      Specified by:
      parents in interface Research
      Returns:
      the value of the parents record component
    • requiresParent

      public boolean requiresParent()
      Returns the value of the requiresParent record component.
      Specified by:
      requiresParent in interface Research
      Returns:
      the value of the requiresParent record component
    • display

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