Record Class ShowElementalDamageS2CPayload
java.lang.Object
java.lang.Record
io.github.xrickastley.sevenelements.networking.ShowElementalDamageS2CPayload
- All Implemented Interfaces:
CustomPayload
public record ShowElementalDamageS2CPayload(Vec3d pos, Element element, float amount, boolean crit)
extends Record
implements CustomPayload
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.packet.CustomPayload
CustomPayload.CodecFactory<B extends PacketByteBuf>, CustomPayload.Id<T extends CustomPayload>, CustomPayload.Type<B extends PacketByteBuf,T extends CustomPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatThe field for theamountrecord component.static final PacketCodec<RegistryByteBuf, ShowElementalDamageS2CPayload> private final booleanThe field for thecritrecord component.private final ElementThe field for theelementrecord component.static final CustomPayload.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.CustomPayload.Id<? extends CustomPayload> 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.
-
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. -
ID
-
CODEC
-
-
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 interfaceCustomPayload
-
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
-