Record Class SkillPoint

java.lang.Object
java.lang.Record
at.minecraftschurli.mods.arsmagicalegacy.api.magic.SkillPoint
Record Components:
color - The color (RGB) of the skill point.
minEarnLevel - The level from which on the skill point will be awarded.
levelsForPoint - The amount of levels required to get the next skill point.

public record SkillPoint(int color, int minEarnLevel, int levelsForPoint) extends Record
Represents a skill point.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<net.minecraft.core.Holder<SkillPoint>>
     
    static final com.mojang.serialization.Codec<SkillPoint>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SkillPoint(int color, int minEarnLevel, int levelsForPoint)
    Creates an instance of a SkillPoint record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the color record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    static net.minecraft.network.chat.MutableComponent
    getName(net.minecraft.core.Holder<SkillPoint> holder)
     
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the levelsForPoint record component.
    int
    Returns the value of the minEarnLevel record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<SkillPoint> DIRECT_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<SkillPoint>> CODEC
  • Constructor Details

    • SkillPoint

      public SkillPoint(int color, int minEarnLevel, int levelsForPoint)
      Creates an instance of a SkillPoint record class.
      Parameters:
      color - the value for the color record component
      minEarnLevel - the value for the minEarnLevel record component
      levelsForPoint - the value for the levelsForPoint record component
  • Method Details

    • getName

      public static net.minecraft.network.chat.MutableComponent getName(net.minecraft.core.Holder<SkillPoint> holder)
      Parameters:
      holder - The skill point Holder to query.
      Returns:
      The display name of the given skill point.
    • 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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      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
    • minEarnLevel

      public int minEarnLevel()
      Returns the value of the minEarnLevel record component.
      Returns:
      the value of the minEarnLevel record component
    • levelsForPoint

      public int levelsForPoint()
      Returns the value of the levelsForPoint record component.
      Returns:
      the value of the levelsForPoint record component