Record Class SyncDendroCoreAgeS2CPayload
java.lang.Object
java.lang.Record
io.github.xrickastley.sevenelements.networking.SyncDendroCoreAgeS2CPayload
- All Implemented Interfaces:
CustomPayload
public record SyncDendroCoreAgeS2CPayload(int entityId, int age)
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 intThe field for theagerecord component.static final PacketCodec<RegistryByteBuf, SyncDendroCoreAgeS2CPayload> private final intThe field for theentityIdrecord component.static final CustomPayload.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.CustomPayload.Id<? extends CustomPayload> getId()final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
entityId
private final int entityIdThe field for theentityIdrecord component. -
age
private final int ageThe field for theagerecord component. -
ID
-
CODEC
-
-
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 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. 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
-