java.lang.Object
java.lang.Record
com.github.minecraftschurlimods.arsmagicalegacy.api.affinity.Ability
Record Components:
affinity - The affinity the ability belongs to.
bounds - The bounds of affinity depth the ability is active in.
All Implemented Interfaces:
ITranslatable, ITranslatable.WithDescription, Predicate<net.minecraft.world.entity.player.Player>

public record Ability(Affinity affinity, net.minecraft.advancements.critereon.MinMaxBounds.Doubles bounds) extends Record implements ITranslatable.WithDescription, Predicate<net.minecraft.world.entity.player.Player>
  • Field Details

    • ABILITY

      public static final String ABILITY
      See Also:
    • REGISTRY_KEY

      public static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<Ability>> REGISTRY_KEY
    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<Ability> DIRECT_CODEC
    • REFERENCE_CODEC

      public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<Ability>> REFERENCE_CODEC
    • LIST_CODEC

      public static final com.mojang.serialization.Codec<net.minecraft.core.HolderSet<Ability>> LIST_CODEC
  • Constructor Details

    • Ability

      public Ability(Affinity affinity, net.minecraft.advancements.critereon.MinMaxBounds.Doubles bounds)
      Creates an instance of a Ability record class.
      Parameters:
      affinity - the value for the affinity record component
      bounds - the value for the bounds record component
  • Method Details

    • test

      public boolean test(net.minecraft.world.entity.player.Player player)
      Specified by:
      test in interface Predicate<net.minecraft.world.entity.player.Player>
    • getType

      public String getType()
      Specified by:
      getType in interface ITranslatable
      Returns:
      The type of this object, for example "block" or "item".
    • getId

      public net.minecraft.resources.ResourceLocation getId(net.minecraft.core.RegistryAccess registryAccess)
      Specified by:
      getId in interface ITranslatable
      Returns:
      The id of this object.
    • 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 Objects::equals(Object,Object).
      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.
    • affinity

      public Affinity affinity()
      Returns the value of the affinity record component.
      Returns:
      the value of the affinity record component
    • bounds

      public net.minecraft.advancements.critereon.MinMaxBounds.Doubles bounds()
      Returns the value of the bounds record component.
      Returns:
      the value of the bounds record component