Record Class Ability
java.lang.Object
java.lang.Record
at.minecraftschurli.mods.arsmagicalegacy.api.ability.Ability
- Record Components:
affinity- TheAffinityto associate the ability with.bounds- TheMinMaxBounds.Doubleswithin which the ability becomes active. Should overlap with the range [0, 1].negative- Whether the ability should be considered negative or not.effects- A list ofAbilityEffects that this ability applies.
- All Implemented Interfaces:
Predicate<net.minecraft.world.entity.player.Player>
public record Ability(net.minecraft.core.Holder<Affinity> affinity, net.minecraft.advancements.criterion.MinMaxBounds.Doubles bounds, boolean negative, List<AbilityEffect> effects)
extends Record
implements Predicate<net.minecraft.world.entity.player.Player>
Represents an affinity ability.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbility(net.minecraft.core.Holder<Affinity> affinity, net.minecraft.advancements.criterion.MinMaxBounds.Doubles bounds, boolean negative, AbilityEffect effect) Ability(net.minecraft.core.Holder<Affinity> affinity, net.minecraft.advancements.criterion.MinMaxBounds.Doubles bounds, boolean negative, List<AbilityEffect> effects) Creates an instance of aAbilityrecord class.Ability(net.minecraft.core.Holder<Affinity> affinity, net.minecraft.advancements.criterion.MinMaxBounds.Doubles bounds, AbilityEffect effect) Ability(net.minecraft.core.Holder<Affinity> affinity, net.minecraft.advancements.criterion.MinMaxBounds.Doubles bounds, List<AbilityEffect> effects) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.Holder<Affinity> affinity()Returns the value of theaffinityrecord component.net.minecraft.advancements.criterion.MinMaxBounds.Doublesbounds()Returns the value of theboundsrecord component.effects()Returns the value of theeffectsrecord 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.booleannegative()Returns the value of thenegativerecord component.booleantest(MagicAttachment data) booleantest(net.minecraft.world.entity.player.Player player) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DIRECT_CODEC
-
CODEC
-
-
Constructor Details
-
Ability
public Ability(net.minecraft.core.Holder<Affinity> affinity, net.minecraft.advancements.criterion.MinMaxBounds.Doubles bounds, List<AbilityEffect> effects) - Parameters:
affinity- TheAffinityto associate the ability with.bounds- TheMinMaxBounds.Doubleswithin which the ability becomes active. Should overlap with the range [0, 1].effects- A list ofAbilityEffects that this ability applies.
-
Ability
public Ability(net.minecraft.core.Holder<Affinity> affinity, net.minecraft.advancements.criterion.MinMaxBounds.Doubles bounds, boolean negative, AbilityEffect effect) - Parameters:
affinity- TheAffinityto associate the ability with.bounds- TheMinMaxBounds.Doubleswithin which the ability becomes active. Should overlap with the range [0, 1].negative- Whether the ability should be considered negative or not.effect- TheAbilityEffectthat this ability applies.
-
Ability
public Ability(net.minecraft.core.Holder<Affinity> affinity, net.minecraft.advancements.criterion.MinMaxBounds.Doubles bounds, AbilityEffect effect) - Parameters:
affinity- TheAffinityto associate the ability with.bounds- TheMinMaxBounds.Doubleswithin which the ability becomes active. Should overlap with the range [0, 1].effect- TheAbilityEffectthat this ability applies.
-
Ability
public Ability(net.minecraft.core.Holder<Affinity> affinity, net.minecraft.advancements.criterion.MinMaxBounds.Doubles bounds, boolean negative, List<AbilityEffect> effects) Creates an instance of aAbilityrecord class.
-
-
Method Details
-
test
-
test
- Parameters:
data- TheMagicAttachmentto query.- Returns:
- Whether the given
MagicAttachmentmatches the bounds.
-
getName
public static net.minecraft.network.chat.MutableComponent getName(net.minecraft.core.Holder<Ability> holder) - Parameters:
holder- The abilityHolderto query.- Returns:
- The display name of the given ability.
-
toString
-
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. -
affinity
-
bounds
-
negative
-
effects
-