Record Class ShowElectroChargeS2CPayload
java.lang.Object
java.lang.Record
io.github.xrickastley.sevenelements.networking.ShowElectroChargeS2CPayload
- All Implemented Interfaces:
SevenElementsPayload,FabricPacket
public record ShowElectroChargeS2CPayload(int mainEntity, List<Integer> otherEntities)
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 TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ShowElectroChargeS2CPayload>static final SevenElementsPayload.Id<ShowElectroChargeS2CPayload>private final intThe field for themainEntityrecord component.The field for theotherEntitiesrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionShowElectroChargeS2CPayload(int mainEntity, List<Integer> otherEntities) Creates an instance of aShowElectroChargeS2CPayloadrecord class.ShowElectroChargeS2CPayload(LivingEntity mainEntity, List<LivingEntity> otherEntities) -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.intReturns the value of themainEntityrecord component.Returns the value of theotherEntitiesrecord 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
-
mainEntity
private final int mainEntityThe field for themainEntityrecord component. -
otherEntities
The field for theotherEntitiesrecord component. -
CODEC
-
ID
-
-
Constructor Details
-
ShowElectroChargeS2CPayload
-
ShowElectroChargeS2CPayload
Creates an instance of aShowElectroChargeS2CPayloadrecord class.- Parameters:
mainEntity- the value for themainEntityrecord componentotherEntities- the value for theotherEntitiesrecord component
-
-
Method Details
-
getCodec
- Specified by:
getCodecin interfaceSevenElementsPayload
-
getId
- Specified by:
getIdin 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 '=='. -
mainEntity
public int mainEntity()Returns the value of themainEntityrecord component.- Returns:
- the value of the
mainEntityrecord component
-
otherEntities
Returns the value of theotherEntitiesrecord component.- Returns:
- the value of the
otherEntitiesrecord component
-