Package com.wdiscute.echoes.perk
Record Class PerkInstance
java.lang.Object
java.lang.Record
com.wdiscute.echoes.perk.PerkInstance
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PerkInstance> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, Perk> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, PerkInstance> -
Constructor Summary
ConstructorsConstructorDescriptionPerkInstance(Perk perk, Map<String, Float> amplifiers) Creates an instance of aPerkInstancerecord class.PerkInstance(net.minecraft.core.Holder<Perk> perk) PerkInstance(net.minecraft.core.Holder<Perk> perk, String id, float value) PerkInstance(net.minecraft.core.Holder<Perk> perk, Map<String, Float> amplifiers) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theamplifiersrecord component.final booleanIndicates whether some other object is "equal to" this one.format(PerkInstance instance, String id) floatfloatfloatgetCost()floatfloatfloatgetHeal()floatgetRange()floatgetValue()final inthashCode()Returns a hash code value for this object.perk()Returns the value of theperkrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
PERK_STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,Perk> PERK_STREAM_CODEC -
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,PerkInstance> STREAM_CODEC
-
-
Constructor Details
-
PerkInstance
-
PerkInstance
-
PerkInstance
-
PerkInstance
Creates an instance of aPerkInstancerecord class.- Parameters:
perk- the value for theperkrecord componentamplifiers- the value for theamplifiersrecord component
-
-
Method Details
-
format
-
get
-
getAsMap
-
getCost
public float getCost() -
getDuration
public float getDuration() -
getDamage
public float getDamage() -
getValue
public float getValue() -
getCooldown
public float getCooldown() -
getHeal
public float getHeal() -
getRange
public float getRange() -
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
perk
Returns the value of theperkrecord component.- Returns:
- the value of the
perkrecord component
-
amplifiers
Returns the value of theamplifiersrecord component.- Returns:
- the value of the
amplifiersrecord component
-