Record Class ShowElementalDamageS2CPayload
java.lang.Object
java.lang.Record
io.github.xrickastley.sevenelements.networking.ShowElementalDamageS2CPayload
- All Implemented Interfaces:
SevenElementsPayload,FabricPacket
public record ShowElementalDamageS2CPayload(Vec3d pos, Element element, float amount, boolean crit)
extends Record
implements SevenElementsPayload
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.xrickastley.sevenelements.networking.SevenElementsPayload
SevenElementsPayload.Id<T extends SevenElementsPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatThe field for theamountrecord component.static final com.mojang.serialization.Codec<ShowElementalDamageS2CPayload>private final booleanThe field for thecritrecord component.private final ElementThe field for theelementrecord component.static final SevenElementsPayload.Id<ShowElementalDamageS2CPayload>private final Vec3dThe field for theposrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionShowElementalDamageS2CPayload(Vec3d pos, Element element, float amount, boolean crit) Creates an instance of aShowElementalDamageS2CPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatamount()Returns the value of theamountrecord component.booleancrit()Returns the value of thecritrecord component.element()Returns the value of theelementrecord component.final booleanIndicates whether some other object is "equal to" this one.com.mojang.serialization.Codec<? extends SevenElementsPayload>getCodec()SevenElementsPayload.Id<? extends SevenElementsPayload>getId()final inthashCode()Returns a hash code value for this object.pos()Returns the value of theposrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.xrickastley.sevenelements.networking.SevenElementsPayload
getType, write
-
Field Details
-
pos
The field for theposrecord component. -
element
The field for theelementrecord component. -
amount
private final float amountThe field for theamountrecord component. -
crit
private final boolean critThe field for thecritrecord component. -
CODEC
-
ID
-
-
Constructor Details
-
ShowElementalDamageS2CPayload
Creates an instance of aShowElementalDamageS2CPayloadrecord class.- Parameters:
pos- the value for theposrecord componentelement- the value for theelementrecord componentamount- the value for theamountrecord componentcrit- the value for thecritrecord component
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceSevenElementsPayload
-
getCodec
- Specified by:
getCodecin interfaceSevenElementsPayload
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
element
Returns the value of theelementrecord component.- Returns:
- the value of the
elementrecord component
-
amount
public float amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
crit
public boolean crit()Returns the value of thecritrecord component.- Returns:
- the value of the
critrecord component
-