Class AbstractTraitType

java.lang.Object
com.hexagram2021.chromosomelib.common.trait.AbstractTraitType
All Implemented Interfaces:
TraitType

public abstract class AbstractTraitType extends Object implements TraitType
Abstract trait type.
  • Field Summary

    Fields inherited from interface com.hexagram2021.chromosomelib.common.trait.TraitType

    COMPARATOR
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractTraitType(net.minecraft.resources.ResourceLocation name)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setValues(net.minecraft.core.HolderSet<Trait> values)
    Set all traits bound to this trait type.
    The string representation of this trait type.
    net.minecraft.core.HolderSet<Trait>
    All traits bound to this trait type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.hexagram2021.chromosomelib.common.trait.TraitType

    example
  • Constructor Details

    • AbstractTraitType

      protected AbstractTraitType(net.minecraft.resources.ResourceLocation name)
      Constructor.
      Parameters:
      name - the name of this trait type
  • Method Details

    • toString

      public String toString()
      Description copied from interface: TraitType
      The string representation of this trait type. It is recommended to use the registry name of this trait type.
      Specified by:
      toString in interface TraitType
      Overrides:
      toString in class Object
      Returns:
      the name of this trait type
    • values

      public net.minecraft.core.HolderSet<Trait> values()
      All traits bound to this trait type.
      Specified by:
      values in interface TraitType
      Returns:
      a collection of traits
    • setValues

      @Internal public void setValues(net.minecraft.core.HolderSet<Trait> values)
      Set all traits bound to this trait type.
      Specified by:
      setValues in interface TraitType
      Parameters:
      values - a collection of traits