Package com.wdiscute.echoes.upgrades
Record Class PerkInstance
java.lang.Object
java.lang.Record
com.wdiscute.echoes.upgrades.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, List<Float> amplifiers) Creates an instance of aPerkInstancerecord class.PerkInstance(net.minecraft.core.Holder<Perk> perk, Float... amplifiers) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theamplifiersrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.perk()Returns the value of theperkrecord component.static net.minecraft.core.component.DataComponentPatchtoPatch(PerkInstance... list) 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
Creates an instance of aPerkInstancerecord class.- Parameters:
perk- the value for theperkrecord componentamplifiers- the value for theamplifiersrecord component
-
-
Method Details
-
toPatch
-
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
-