Record Class SyncDendroCoreAgeS2CPayload
java.lang.Object
java.lang.Record
io.github.xrickastley.sevenelements.networking.SyncDendroCoreAgeS2CPayload
- All Implemented Interfaces:
SevenElementsPayload,FabricPacket
public record SyncDendroCoreAgeS2CPayload(int entityId, int age)
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 intThe field for theagerecord component.static final com.mojang.serialization.Codec<SyncDendroCoreAgeS2CPayload>private final intThe field for theentityIdrecord component.static final SevenElementsPayload.Id<SyncDendroCoreAgeS2CPayload> -
Constructor Summary
ConstructorsConstructorDescriptionSyncDendroCoreAgeS2CPayload(int entityId, int age) Creates an instance of aSyncDendroCoreAgeS2CPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintage()Returns the value of theagerecord component.intentityId()Returns the value of theentityIdrecord 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.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
-
entityId
private final int entityIdThe field for theentityIdrecord component. -
age
private final int ageThe field for theagerecord component. -
CODEC
-
ID
-
-
Constructor Details
-
SyncDendroCoreAgeS2CPayload
public SyncDendroCoreAgeS2CPayload(int entityId, int age) Creates an instance of aSyncDendroCoreAgeS2CPayloadrecord class.- Parameters:
entityId- the value for theentityIdrecord componentage- the value for theagerecord 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. All components in this record class are compared with '=='. -
entityId
public int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-
age
public int age()Returns the value of theagerecord component.- Returns:
- the value of the
agerecord component
-