Record Class NameStyle
java.lang.Object
java.lang.Record
net.darkhax.darkutilities.common.component.NameStyle
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<NameStyle> static final net.darkhax.bookshelf.common.api.function.CachedSupplier<net.minecraft.core.component.DataComponentType<NameStyle>> static final net.minecraft.resources.ResourceLocationstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, NameStyle> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<net.minecraft.world.item.DyeColor> color()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.resources.ResourceLocationfontID()Returns the value of thefontIDrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
ID
public static final net.minecraft.resources.ResourceLocation ID -
COMPONENT
public static final net.darkhax.bookshelf.common.api.function.CachedSupplier<net.minecraft.core.component.DataComponentType<NameStyle>> COMPONENT -
CODEC
-
STREAM
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,NameStyle> STREAM
-
-
Constructor Details
-
NameStyle
public NameStyle(net.minecraft.resources.ResourceLocation fontID, Optional<net.minecraft.world.item.DyeColor> color) Creates an instance of aNameStylerecord class.- Parameters:
fontID- the value for thefontIDrecord componentcolor- the value for thecolorrecord component
-
-
Method Details
-
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 withObjects::equals(Object,Object). -
fontID
public net.minecraft.resources.ResourceLocation fontID()Returns the value of thefontIDrecord component.- Returns:
- the value of the
fontIDrecord component
-
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-