java.lang.Object
java.lang.Record
com.github.minecraftschurlimods.arsmagicalegacy.api.affinity.Affinity
Record Components:
color - The color for this affinity.
minorOpposites - The minor opposing affinities for this affinity.
majorOpposites - The major opposing affinities for this affinity.
directOpposite - The direct opposing affinity for this affinity.
castSound - The sound to play when casting a spell with this affinity.
loopSound - The sound to play when casting a continuous spell with this affinity.
particle - The particle type associated with this affinity.
All Implemented Interfaces:
ITranslatable, Comparable<Affinity>

public record Affinity(int color, Set<net.minecraft.resources.ResourceLocation> minorOpposites, Set<net.minecraft.resources.ResourceLocation> majorOpposites, net.minecraft.resources.ResourceLocation directOpposite, @Nullable net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> castSound, @Nullable net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> loopSound, Supplier<? extends net.minecraft.core.particles.ParticleOptions> particle) extends Record implements Comparable<Affinity>, ITranslatable
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from interface com.github.minecraftschurlimods.arsmagicalegacy.api.util.ITranslatable

    ITranslatable.WithDescription
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final net.minecraft.resources.ResourceLocation
     
    static final net.minecraft.resources.ResourceLocation
     
    static final net.minecraft.resources.ResourceLocation
     
    static final net.minecraft.resources.ResourceLocation
     
    static final net.minecraft.resources.ResourceLocation
     
    static final net.minecraft.resources.ResourceLocation
     
    static final net.minecraft.resources.ResourceLocation
     
    static final net.minecraft.resources.ResourceLocation
     
    static final net.minecraft.resources.ResourceLocation
     
    static final net.minecraft.resources.ResourceLocation
     
    static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<Affinity>>
     
    static final net.minecraft.resources.ResourceLocation
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Affinity(int color, Set<net.minecraft.resources.ResourceLocation> minorOpposites, Set<net.minecraft.resources.ResourceLocation> majorOpposites, net.minecraft.resources.ResourceLocation directOpposite, @Nullable net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> castSound, @Nullable net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> loopSound, Supplier<? extends net.minecraft.core.particles.ParticleOptions> particle)
    Creates an instance of a Affinity record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    @Nullable net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>
    Returns the value of the castSound record component.
    int
    Returns the value of the color record component.
    int
     
    net.minecraft.resources.ResourceLocation
    Returns the value of the directOpposite record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Set<net.minecraft.resources.ResourceLocation>
     
    net.minecraft.resources.ResourceLocation
     
    @Nullable net.minecraft.core.particles.ParticleOptions
     
     
    final int
    Returns a hash code value for this object.
    @Nullable net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>
    Returns the value of the loopSound record component.
    @Unmodifiable Set<net.minecraft.resources.ResourceLocation>
    Returns the value of the majorOpposites record component.
    @Unmodifiable Set<net.minecraft.resources.ResourceLocation>
    Returns the value of the minorOpposites record component.
    Supplier<? extends net.minecraft.core.particles.ParticleOptions>
    Returns the value of the particle record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.github.minecraftschurlimods.arsmagicalegacy.api.util.ITranslatable

    getDisplayName, getDisplayName, getId, getTranslationKey, getTranslationKey
  • Field Details

    • AFFINITY

      public static final String AFFINITY
      See Also:
    • REGISTRY_KEY

      public static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<Affinity>> REGISTRY_KEY
    • NONE

      public static final net.minecraft.resources.ResourceLocation NONE
    • ARCANE

      public static final net.minecraft.resources.ResourceLocation ARCANE
    • WATER

      public static final net.minecraft.resources.ResourceLocation WATER
    • FIRE

      public static final net.minecraft.resources.ResourceLocation FIRE
    • EARTH

      public static final net.minecraft.resources.ResourceLocation EARTH
    • AIR

      public static final net.minecraft.resources.ResourceLocation AIR
    • LIGHTNING

      public static final net.minecraft.resources.ResourceLocation LIGHTNING
    • ICE

      public static final net.minecraft.resources.ResourceLocation ICE
    • NATURE

      public static final net.minecraft.resources.ResourceLocation NATURE
    • LIFE

      public static final net.minecraft.resources.ResourceLocation LIFE
    • ENDER

      public static final net.minecraft.resources.ResourceLocation ENDER
  • Constructor Details

    • Affinity

      public Affinity(int color, Set<net.minecraft.resources.ResourceLocation> minorOpposites, Set<net.minecraft.resources.ResourceLocation> majorOpposites, net.minecraft.resources.ResourceLocation directOpposite, @Nullable @Nullable net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> castSound, @Nullable @Nullable net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> loopSound, Supplier<? extends net.minecraft.core.particles.ParticleOptions> particle)
      Creates an instance of a Affinity record class.
      Parameters:
      color - the value for the color record component
      minorOpposites - the value for the minorOpposites record component
      majorOpposites - the value for the majorOpposites record component
      directOpposite - the value for the directOpposite record component
      castSound - the value for the castSound record component
      loopSound - the value for the loopSound record component
      particle - the value for the particle record component
  • Method Details

    • builder

      public static Affinity.Builder builder()
      Returns:
      A new affinity builder.
    • minorOpposites

      public @Unmodifiable Set<net.minecraft.resources.ResourceLocation> minorOpposites()
      Returns the value of the minorOpposites record component.
      Returns:
      the value of the minorOpposites record component
    • majorOpposites

      public @Unmodifiable Set<net.minecraft.resources.ResourceLocation> majorOpposites()
      Returns the value of the majorOpposites record component.
      Returns:
      the value of the majorOpposites record component
    • getAdjacentAffinities

      public Set<net.minecraft.resources.ResourceLocation> getAdjacentAffinities()
      Returns:
      The adjacent affinities for this affinity.
    • getParticle

      @Nullable public @Nullable net.minecraft.core.particles.ParticleOptions getParticle()
      Returns:
      The sound that should be played when casting a continuous spell with this affinity.
    • 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()
      Specified by:
      getId in interface ITranslatable
      Returns:
      The id of this object.
    • compareTo

      public int compareTo(Affinity o)
      Specified by:
      compareTo in interface Comparable<Affinity>
    • 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.
    • color

      public int color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • directOpposite

      public net.minecraft.resources.ResourceLocation directOpposite()
      Returns the value of the directOpposite record component.
      Returns:
      the value of the directOpposite record component
    • castSound

      @Nullable public @Nullable net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> castSound()
      Returns the value of the castSound record component.
      Returns:
      the value of the castSound record component
    • loopSound

      @Nullable public @Nullable net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> loopSound()
      Returns the value of the loopSound record component.
      Returns:
      the value of the loopSound record component
    • particle

      public Supplier<? extends net.minecraft.core.particles.ParticleOptions> particle()
      Returns the value of the particle record component.
      Returns:
      the value of the particle record component