Package top.girlkisser.lazuli.api.colour
Record Class ColourPalette
java.lang.Object
java.lang.Record
top.girlkisser.lazuli.api.colour.ColourPalette
- Record Components:
colours- The palette's colours.
A palette of
UnpackedColours.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ColourPalette> static final com.mojang.serialization.Codec<ColourPalette> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ColourPalette> -
Constructor Summary
ConstructorsConstructorDescriptionColourPalette(List<UnpackedColour> colours) A palette ofUnpackedColours.ColourPalette(UnpackedColour... colours) Creates an instance of aColourPaletterecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolours()Returns the value of thecoloursrecord component.final booleanIndicates whether some other object is "equal to" this one.getRandom(net.minecraft.util.RandomSource random) Gets a random colour from the palette.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
PACKED_CODEC
-
PACKED_STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ColourPalette> PACKED_STREAM_CODEC
-
-
Constructor Details
-
ColourPalette
A palette ofUnpackedColours.- Parameters:
colours- The palette's colours.
-
ColourPalette
Creates an instance of aColourPaletterecord class.- Parameters:
colours- the value for thecoloursrecord component
-
-
Method Details
-
getRandom
Gets a random colour from the palette.- Parameters:
random- The random source to use.- Returns:
- A random unpacked colour.
-
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). -
colours
Returns the value of thecoloursrecord component.- Returns:
- the value of the
coloursrecord component
-