Package com.wdiscute.echoes.timeless
Record Class TimelessHearts
java.lang.Object
java.lang.Record
com.wdiscute.echoes.timeless.TimelessHearts
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TimelessHearts> static final TimelessHeartsstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, TimelessHearts> -
Constructor Summary
ConstructorsConstructorDescriptionTimelessHearts(int soulHearts, int soulHP) Creates an instance of aTimelessHeartsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidabsorbSoul(net.minecraft.world.entity.player.Player player) static voidaddHeart(net.minecraft.world.entity.player.Player player) final booleanIndicates whether some other object is "equal to" this one.static TimelessHeartsget(net.minecraft.world.entity.player.Player player) static intgetAbsorbedDamage(net.minecraft.world.entity.player.Player player, int damage) final inthashCode()Returns a hash code value for this object.intReturns the value of thesoulHeartsrecord component.intsoulHP()Returns the value of thesoulHPrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,TimelessHearts> STREAM_CODEC
-
-
Constructor Details
-
TimelessHearts
public TimelessHearts(int soulHearts, int soulHP) Creates an instance of aTimelessHeartsrecord class.- Parameters:
soulHearts- the value for thesoulHeartsrecord componentsoulHP- the value for thesoulHPrecord component
-
-
Method Details
-
get
-
getAbsorbedDamage
public static int getAbsorbedDamage(net.minecraft.world.entity.player.Player player, int damage) -
addHeart
public static void addHeart(net.minecraft.world.entity.player.Player player) -
absorbSoul
public static void absorbSoul(net.minecraft.world.entity.player.Player player) -
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 with '=='. -
soulHearts
public int soulHearts()Returns the value of thesoulHeartsrecord component.- Returns:
- the value of the
soulHeartsrecord component
-
soulHP
public int soulHP()Returns the value of thesoulHPrecord component.- Returns:
- the value of the
soulHPrecord component
-