Record Class Affinity
java.lang.Object
java.lang.Record
at.minecraftschurli.mods.arsmagicalegacy.api.magic.Affinity
- Record Components:
directOpposite- The direct opposite affinity. When shifting into an affinity, one will also shift away by a large amount from the direct opposite.majorOpposites- The major opposite affinities. When shifting into an affinity, one will also shift away by a moderate amount from the major opposites.minorOpposites- The minor opposite affinities. When shifting into an affinity, one will also shift away by a small amount from the minor opposites.adjacents- The adjacent affinities. When shifting into an affinity, one will also shift towards the adjacents by a small amount.color- The color of the affinity.index- The index of the affinity when displaying in the occulus. The built-in affinities use int values 1-10, use floating point values to insert your affinities between them. Use values < 0 to not display the affinity in the occulus.castSound- TheSoundEventto use for castingSpells with the affinity.loopSound- TheSoundEventto use for casting continuousSpells with the affinity.particle- TheParticleOptionsto associate with the affinity.
public record Affinity(net.minecraft.core.Holder<Affinity> directOpposite, List<net.minecraft.core.Holder<Affinity>> majorOpposites, List<net.minecraft.core.Holder<Affinity>> minorOpposites, List<net.minecraft.core.Holder<Affinity>> adjacents, int color, double index, Optional<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> castSound, Optional<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> loopSound, net.minecraft.core.particles.ParticleOptions particle)
extends Record
Represents an affinity.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAffinity(net.minecraft.core.Holder<Affinity> directOpposite, List<net.minecraft.core.Holder<Affinity>> majorOpposites, List<net.minecraft.core.Holder<Affinity>> minorOpposites, List<net.minecraft.core.Holder<Affinity>> adjacents, int color, double index, Optional<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> castSound, Optional<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> loopSound, net.minecraft.core.particles.ParticleOptions particle) Creates an instance of aAffinityrecord class.Affinity(net.minecraft.core.Holder<Affinity> directOpposite, List<net.minecraft.core.Holder<Affinity>> majorOpposites, List<net.minecraft.core.Holder<Affinity>> minorOpposites, List<net.minecraft.core.Holder<Affinity>> adjacents, int color, double index, net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> castSound, net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> loopSound, net.minecraft.core.particles.ParticleOptions particle) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadjacentsrecord component.Optional<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> Returns the value of thecastSoundrecord component.intcolor()Returns the value of thecolorrecord component.net.minecraft.core.Holder<Affinity> Returns the value of thedirectOppositerecord component.final booleanIndicates whether some other object is "equal to" this one.static net.minecraft.network.chat.MutableComponentfinal inthashCode()Returns a hash code value for this object.doubleindex()Returns the value of theindexrecord component.Optional<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> Returns the value of theloopSoundrecord component.Returns the value of themajorOppositesrecord component.Returns the value of theminorOppositesrecord component.net.minecraft.core.particles.ParticleOptionsparticle()Returns the value of theparticlerecord component.toString()Returns a string representation of this record class.
-
Field Details
-
DIRECT_CODEC
-
CODEC
-
NONE
-
-
Constructor Details
-
Affinity
public Affinity(net.minecraft.core.Holder<Affinity> directOpposite, List<net.minecraft.core.Holder<Affinity>> majorOpposites, List<net.minecraft.core.Holder<Affinity>> minorOpposites, List<net.minecraft.core.Holder<Affinity>> adjacents, int color, double index, net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> castSound, net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> loopSound, net.minecraft.core.particles.ParticleOptions particle) - Parameters:
directOpposite- The direct opposite affinity.majorOpposites- The major opposite affinities.minorOpposites- The minor opposite affinities.adjacents- The adjacent affinities.color- The color of the affinity.index- The index of the affinity when displaying in the occulus.castSound- TheSoundEventto use for casting spells with the affinity.loopSound- TheSoundEventto use for casting continuous spells with the affinity.particle- TheParticleOptionsto associate with the affinity.
-
Affinity
public Affinity(net.minecraft.core.Holder<Affinity> directOpposite, List<net.minecraft.core.Holder<Affinity>> majorOpposites, List<net.minecraft.core.Holder<Affinity>> minorOpposites, List<net.minecraft.core.Holder<Affinity>> adjacents, int color, double index, Optional<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> castSound, Optional<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> loopSound, net.minecraft.core.particles.ParticleOptions particle) Creates an instance of aAffinityrecord class.- Parameters:
directOpposite- the value for thedirectOppositerecord componentmajorOpposites- the value for themajorOppositesrecord componentminorOpposites- the value for theminorOppositesrecord componentadjacents- the value for theadjacentsrecord componentcolor- the value for thecolorrecord componentindex- the value for theindexrecord componentcastSound- the value for thecastSoundrecord componentloopSound- the value for theloopSoundrecord componentparticle- the value for theparticlerecord component
-
-
Method Details
-
toString
-
getName
public static net.minecraft.network.chat.MutableComponent getName(net.minecraft.core.Holder<Affinity> holder) - Parameters:
holder- The affinityHolderto query.- Returns:
- The display name of the given affinity.
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
directOpposite
Returns the value of thedirectOppositerecord component.- Returns:
- the value of the
directOppositerecord component
-
majorOpposites
Returns the value of themajorOppositesrecord component.- Returns:
- the value of the
majorOppositesrecord component
-
minorOpposites
Returns the value of theminorOppositesrecord component.- Returns:
- the value of the
minorOppositesrecord component
-
adjacents
-
color
-
index
-
castSound
-
loopSound
-
particle
-