Record Class FireworkExplosion

java.lang.Object
java.lang.Record
net.minecraft.world.item.component.FireworkExplosion
All Implemented Interfaces:
TooltipProvider

public record FireworkExplosion(FireworkExplosion.Shape shape, it.unimi.dsi.fastutil.ints.IntList colors, it.unimi.dsi.fastutil.ints.IntList fadeColors, boolean hasTrail, boolean hasTwinkle) extends Record implements TooltipProvider
  • Field Details

    • shape

      private final FireworkExplosion.Shape shape
      The field for the shape record component.
    • colors

      private final it.unimi.dsi.fastutil.ints.IntList colors
      The field for the colors record component.
    • fadeColors

      private final it.unimi.dsi.fastutil.ints.IntList fadeColors
      The field for the fadeColors record component.
    • hasTrail

      private final boolean hasTrail
      The field for the hasTrail record component.
    • hasTwinkle

      private final boolean hasTwinkle
      The field for the hasTwinkle record component.
    • DEFAULT

      public static final FireworkExplosion DEFAULT
    • COLOR_LIST_CODEC

      public static final com.mojang.serialization.Codec<it.unimi.dsi.fastutil.ints.IntList> COLOR_LIST_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<FireworkExplosion> CODEC
    • COLOR_LIST_STREAM_CODEC

      private static final StreamCodec<io.netty.buffer.ByteBuf,it.unimi.dsi.fastutil.ints.IntList> COLOR_LIST_STREAM_CODEC
    • STREAM_CODEC

      public static final StreamCodec<io.netty.buffer.ByteBuf,FireworkExplosion> STREAM_CODEC
    • CUSTOM_COLOR_NAME

      private static final Component CUSTOM_COLOR_NAME
  • Constructor Details

    • FireworkExplosion

      public FireworkExplosion(FireworkExplosion.Shape shape, it.unimi.dsi.fastutil.ints.IntList colors, it.unimi.dsi.fastutil.ints.IntList fadeColors, boolean hasTrail, boolean hasTwinkle)
      Creates an instance of a FireworkExplosion record class.
      Parameters:
      shape - the value for the shape record component
      colors - the value for the colors record component
      fadeColors - the value for the fadeColors record component
      hasTrail - the value for the hasTrail record component
      hasTwinkle - the value for the hasTwinkle record component
  • Method Details

    • addToTooltip

      public void addToTooltip(Item.TooltipContext p_341341_, Consumer<Component> p_331404_, TooltipFlag p_330365_)
      Specified by:
      addToTooltip in interface TooltipProvider
    • addShapeNameTooltip

      public void addShapeNameTooltip(Consumer<Component> p_331748_)
    • addAdditionalTooltip

      public void addAdditionalTooltip(Consumer<Component> p_331075_)
    • appendColors

      private static Component appendColors(MutableComponent p_331806_, it.unimi.dsi.fastutil.ints.IntList p_330350_)
    • getColorName

      private static Component getColorName(int p_330226_)
    • withFadeColors

      public FireworkExplosion withFadeColors(it.unimi.dsi.fastutil.ints.IntList p_330678_)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • shape

      public FireworkExplosion.Shape shape()
      Returns the value of the shape record component.
      Returns:
      the value of the shape record component
    • colors

      public it.unimi.dsi.fastutil.ints.IntList colors()
      Returns the value of the colors record component.
      Returns:
      the value of the colors record component
    • fadeColors

      public it.unimi.dsi.fastutil.ints.IntList fadeColors()
      Returns the value of the fadeColors record component.
      Returns:
      the value of the fadeColors record component
    • hasTrail

      public boolean hasTrail()
      Returns the value of the hasTrail record component.
      Returns:
      the value of the hasTrail record component
    • hasTwinkle

      public boolean hasTwinkle()
      Returns the value of the hasTwinkle record component.
      Returns:
      the value of the hasTwinkle record component