Record Class BossBarStylePayload
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.internal.bossbar.BossBarStylePayload
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
public record BossBarStylePayload(UUID bar, @Nullable net.minecraft.resources.Identifier style, int entityId)
extends Record
implements net.minecraft.network.protocol.common.custom.CustomPacketPayload
Server to client: the style a boss bar is drawn in (
CustomBossBars), and the entity it belongs to (-1 for
none). A null style puts it back to the game's own bar.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B,T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, BossBarStylePayload> static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<BossBarStylePayload> -
Constructor Summary
ConstructorsConstructorDescriptionBossBarStylePayload(UUID bar, @Nullable net.minecraft.resources.Identifier style, int entityId) Creates an instance of aBossBarStylePayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbar()Returns the value of thebarrecord component.intentityId()Returns the value of theentityIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable net.minecraft.resources.Identifierstyle()Returns the value of thestylerecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type()
-
Field Details
-
TYPE
public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<BossBarStylePayload> TYPE -
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, BossBarStylePayload> STREAM_CODEC
-
-
Constructor Details
-
BossBarStylePayload
public BossBarStylePayload(UUID bar, @Nullable @Nullable net.minecraft.resources.Identifier style, int entityId) Creates an instance of aBossBarStylePayloadrecord class.- Parameters:
bar- the value for thebarrecord componentstyle- the value for thestylerecord componententityId- the value for theentityIdrecord component
-
-
Method Details
-
type
public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type()- Specified by:
typein interfacenet.minecraft.network.protocol.common.custom.CustomPacketPayload
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
bar
Returns the value of thebarrecord component.- Returns:
- the value of the
barrecord component
-
style
@Nullable public @Nullable net.minecraft.resources.Identifier style()Returns the value of thestylerecord component.- Returns:
- the value of the
stylerecord component
-
entityId
public int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-