Record Class SyncBossBarEntityS2CPayload
java.lang.Object
java.lang.Record
io.github.xrickastley.sevenelements.networking.SyncBossBarEntityS2CPayload
- All Implemented Interfaces:
CustomPayload
public record SyncBossBarEntityS2CPayload(UUID uuid, boolean hasEntity, int entityId)
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 TypeFieldDescriptionstatic final PacketCodec<RegistryByteBuf, SyncBossBarEntityS2CPayload> private final intThe field for theentityIdrecord component.private final booleanThe field for thehasEntityrecord component.static final CustomPayload.Id<SyncBossBarEntityS2CPayload> private final UUIDThe field for theuuidrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSyncBossBarEntityS2CPayload(UUID uuid, boolean hasEntity, int entityId) Creates an instance of aSyncBossBarEntityS2CPayloadrecord class.SyncBossBarEntityS2CPayload(BossBar bossBar, LivingEntity entity) -
Method Summary
Modifier and TypeMethodDescriptionintentityId()Returns the value of theentityIdrecord component.final booleanIndicates whether some other object is "equal to" this one.CustomPayload.Id<? extends CustomPayload> getId()booleanReturns the value of thehasEntityrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.uuid()Returns the value of theuuidrecord component.
-
Field Details
-
uuid
The field for theuuidrecord component. -
hasEntity
private final boolean hasEntityThe field for thehasEntityrecord component. -
entityId
private final int entityIdThe field for theentityIdrecord component. -
ID
-
CODEC
-
-
Constructor Details
-
SyncBossBarEntityS2CPayload
-
SyncBossBarEntityS2CPayload
Creates an instance of aSyncBossBarEntityS2CPayloadrecord class.- Parameters:
uuid- the value for theuuidrecord componenthasEntity- the value for thehasEntityrecord componententityId- the value for theentityIdrecord 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 '=='. -
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
hasEntity
public boolean hasEntity()Returns the value of thehasEntityrecord component.- Returns:
- the value of the
hasEntityrecord component
-
entityId
public int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-