Record Class ColorCollection<T>

java.lang.Object
java.lang.Record
net.minecraft.world.level.block.ColorCollection<T>

public record ColorCollection<T>(T white, T orange, T magenta, T lightBlue, T yellow, T lime, T pink, T gray, T lightGray, T cyan, T purple, T blue, T brown, T green, T red, T black) extends Record
  • Field Details

    • white

      private final T white
      The field for the white record component.
    • orange

      private final T orange
      The field for the orange record component.
    • magenta

      private final T magenta
      The field for the magenta record component.
    • lightBlue

      private final T lightBlue
      The field for the lightBlue record component.
    • yellow

      private final T yellow
      The field for the yellow record component.
    • lime

      private final T lime
      The field for the lime record component.
    • pink

      private final T pink
      The field for the pink record component.
    • gray

      private final T gray
      The field for the gray record component.
    • lightGray

      private final T lightGray
      The field for the lightGray record component.
    • cyan

      private final T cyan
      The field for the cyan record component.
    • purple

      private final T purple
      The field for the purple record component.
    • blue

      private final T blue
      The field for the blue record component.
    • brown

      private final T brown
      The field for the brown record component.
    • green

      private final T green
      The field for the green record component.
    • red

      private final T red
      The field for the red record component.
    • black

      private final T black
      The field for the black record component.
    • VALUES

      public static final ColorCollection<DyeColor> VALUES
    • NAMES

      public static final ColorCollection<String> NAMES
  • Constructor Details

    • ColorCollection

      public ColorCollection(T white, T orange, T magenta, T lightBlue, T yellow, T lime, T pink, T gray, T lightGray, T cyan, T purple, T blue, T brown, T green, T red, T black)
      Creates an instance of a ColorCollection record class.
      Parameters:
      white - the value for the white record component
      orange - the value for the orange record component
      magenta - the value for the magenta record component
      lightBlue - the value for the lightBlue record component
      yellow - the value for the yellow record component
      lime - the value for the lime record component
      pink - the value for the pink record component
      gray - the value for the gray record component
      lightGray - the value for the lightGray record component
      cyan - the value for the cyan record component
      purple - the value for the purple record component
      blue - the value for the blue record component
      brown - the value for the brown record component
      green - the value for the green record component
      red - the value for the red record component
      black - the value for the black record component
  • Method Details

    • create

      public static <T> ColorCollection<T> create(T value)
    • registerBlocks

      public static <B extends Block, Id> ColorCollection<Block> registerBlocks(ColorCollection<Id> ids, org.apache.commons.lang3.function.TriFunction<Id, Function<BlockBehaviour.Properties, Block>, BlockBehaviour.Properties, Block> register, BiFunction<DyeColor, BlockBehaviour.Properties, B> colorBlockFactory, Function<DyeColor, BlockBehaviour.Properties> propertiesSupplier)
    • registerBlockItems

      public static <Id> ColorCollection<Item> registerBlockItems(ColorCollection<Id> ids, ColorCollection<Block> blocks, org.apache.commons.lang3.function.TriFunction<Id,Block,DyeColor,Item> itemFactory)
    • registerItems

      public static <Id> ColorCollection<Item> registerItems(ColorCollection<Id> ids, BiFunction<Id,DyeColor,Item> itemFactory)
    • prefixWithColor

      public static ColorCollection<String> prefixWithColor(ColorCollection<String> ids)
    • asList

      public List<T> asList()
    • forEach

      public void forEach(Consumer<T> consumer)
    • pick

      public T pick(DyeColor dyeColor)
    • map

      public <U> ColorCollection<U> map(Function<T,U> mapper)
    • zipApply

      public static <T,U> void zipApply(ColorCollection<T> first, ColorCollection<U> second, BiConsumer<T,U> consumer)
    • zipMap

      public static <T,U,R> ColorCollection<R> zipMap(ColorCollection<T> first, ColorCollection<U> second, BiFunction<T,U,R> operation)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • white

      public T white()
      Returns the value of the white record component.
      Returns:
      the value of the white record component
    • orange

      public T orange()
      Returns the value of the orange record component.
      Returns:
      the value of the orange record component
    • magenta

      public T magenta()
      Returns the value of the magenta record component.
      Returns:
      the value of the magenta record component
    • lightBlue

      public T lightBlue()
      Returns the value of the lightBlue record component.
      Returns:
      the value of the lightBlue record component
    • yellow

      public T yellow()
      Returns the value of the yellow record component.
      Returns:
      the value of the yellow record component
    • lime

      public T lime()
      Returns the value of the lime record component.
      Returns:
      the value of the lime record component
    • pink

      public T pink()
      Returns the value of the pink record component.
      Returns:
      the value of the pink record component
    • gray

      public T gray()
      Returns the value of the gray record component.
      Returns:
      the value of the gray record component
    • lightGray

      public T lightGray()
      Returns the value of the lightGray record component.
      Returns:
      the value of the lightGray record component
    • cyan

      public T cyan()
      Returns the value of the cyan record component.
      Returns:
      the value of the cyan record component
    • purple

      public T purple()
      Returns the value of the purple record component.
      Returns:
      the value of the purple record component
    • blue

      public T blue()
      Returns the value of the blue record component.
      Returns:
      the value of the blue record component
    • brown

      public T brown()
      Returns the value of the brown record component.
      Returns:
      the value of the brown record component
    • green

      public T green()
      Returns the value of the green record component.
      Returns:
      the value of the green record component
    • red

      public T red()
      Returns the value of the red record component.
      Returns:
      the value of the red record component
    • black

      public T black()
      Returns the value of the black record component.
      Returns:
      the value of the black record component