Record Class Skill

java.lang.Object
java.lang.Record
at.minecraftschurli.mods.arsmagicalegacy.api.magic.Skill
Record Components:
parents - A List of parent Skill Holders.
cost - The cost of the skill. If absent, the skill has no cost.
tab - The OcculusTab the skill resides in.
x - The x position of the skill.
y - The y position of the skill.
hidden - Whether the skill is hidden. Hidden skills will only show when learned through means other than within the occulus, e.g. via command.

public record Skill(List<net.minecraft.core.Holder<Skill>> parents, Optional<net.minecraft.core.Holder<SkillPoint>> cost, net.minecraft.core.Holder<OcculusTab> tab, int x, int y, boolean hidden) extends Record
Represents a skill.
  • Field Summary

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

    Constructors
    Constructor
    Description
    Skill(List<net.minecraft.core.Holder<Skill>> parents, Optional<net.minecraft.core.Holder<SkillPoint>> cost, net.minecraft.core.Holder<OcculusTab> tab, int x, int y, boolean hidden)
    Creates an instance of a Skill record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<net.minecraft.core.Holder<SkillPoint>>
    Returns the value of the cost record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    static net.minecraft.network.chat.MutableComponent
    getDescription(net.minecraft.core.Holder<Skill> holder)
     
    static net.minecraft.network.chat.MutableComponent
    getName(net.minecraft.core.Holder<Skill> holder)
     
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the hidden record component.
    List<net.minecraft.core.Holder<Skill>>
    Returns the value of the parents record component.
    net.minecraft.core.Holder<OcculusTab>
    tab()
    Returns the value of the tab record component.
    final String
    Returns a string representation of this record class.
    int
    x()
    Returns the value of the x record component.
    int
    y()
    Returns the value of the y record component.

    Methods inherited from class Object

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

    • DIRECT_CODEC

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

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

    • Skill

      public Skill(List<net.minecraft.core.Holder<Skill>> parents, Optional<net.minecraft.core.Holder<SkillPoint>> cost, net.minecraft.core.Holder<OcculusTab> tab, int x, int y, boolean hidden)
      Creates an instance of a Skill record class.
      Parameters:
      parents - the value for the parents record component
      cost - the value for the cost record component
      tab - the value for the tab record component
      x - the value for the x record component
      y - the value for the y record component
      hidden - the value for the hidden record component
  • Method Details

    • getName

      public static net.minecraft.network.chat.MutableComponent getName(net.minecraft.core.Holder<Skill> holder)
      Parameters:
      holder - The skill Holder to query.
      Returns:
      The display name of the given skill.
    • getDescription

      public static net.minecraft.network.chat.MutableComponent getDescription(net.minecraft.core.Holder<Skill> holder)
      Parameters:
      holder - The skill Holder to query.
      Returns:
      The description of the given skill.
    • 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 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.
    • parents

      public List<net.minecraft.core.Holder<Skill>> parents()
      Returns the value of the parents record component.
      Returns:
      the value of the parents record component
    • cost

      public Optional<net.minecraft.core.Holder<SkillPoint>> cost()
      Returns the value of the cost record component.
      Returns:
      the value of the cost record component
    • tab

      public net.minecraft.core.Holder<OcculusTab> tab()
      Returns the value of the tab record component.
      Returns:
      the value of the tab record component
    • x

      public int x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public int y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • hidden

      public boolean hidden()
      Returns the value of the hidden record component.
      Returns:
      the value of the hidden record component