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
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<FireworkExplosion> static final com.mojang.serialization.Codec<it.unimi.dsi.fastutil.ints.IntList> private static final StreamCodec<io.netty.buffer.ByteBuf, it.unimi.dsi.fastutil.ints.IntList> private final it.unimi.dsi.fastutil.ints.IntListThe field for thecolorsrecord component.private static final Componentstatic final FireworkExplosionprivate final it.unimi.dsi.fastutil.ints.IntListThe field for thefadeColorsrecord component.private final booleanThe field for thehasTrailrecord component.private final booleanThe field for thehasTwinklerecord component.private final FireworkExplosion.ShapeThe field for theshaperecord component.static final StreamCodec<io.netty.buffer.ByteBuf, FireworkExplosion> 
- 
Constructor SummaryConstructorsConstructorDescriptionFireworkExplosion(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 aFireworkExplosionrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddAdditionalTooltip(Consumer<Component> p_331075_) voidaddShapeNameTooltip(Consumer<Component> p_331748_) voidaddToTooltip(Item.TooltipContext p_341341_, Consumer<Component> p_331404_, TooltipFlag p_330365_) private static ComponentappendColors(MutableComponent p_331806_, it.unimi.dsi.fastutil.ints.IntList p_330350_) it.unimi.dsi.fastutil.ints.IntListcolors()Returns the value of thecolorsrecord component.final booleanIndicates whether some other object is "equal to" this one.it.unimi.dsi.fastutil.ints.IntListReturns the value of thefadeColorsrecord component.private static ComponentgetColorName(int p_330226_) final inthashCode()Returns a hash code value for this object.booleanhasTrail()Returns the value of thehasTrailrecord component.booleanReturns the value of thehasTwinklerecord component.shape()Returns the value of theshaperecord component.final StringtoString()Returns a string representation of this record class.withFadeColors(it.unimi.dsi.fastutil.ints.IntList p_330678_) 
- 
Field Details- 
shapeThe field for theshaperecord component.
- 
colorsprivate final it.unimi.dsi.fastutil.ints.IntList colorsThe field for thecolorsrecord component.
- 
fadeColorsprivate final it.unimi.dsi.fastutil.ints.IntList fadeColorsThe field for thefadeColorsrecord component.
- 
hasTrailprivate final boolean hasTrailThe field for thehasTrailrecord component.
- 
hasTwinkleprivate final boolean hasTwinkleThe field for thehasTwinklerecord component.
- 
DEFAULT
- 
COLOR_LIST_CODECpublic static final com.mojang.serialization.Codec<it.unimi.dsi.fastutil.ints.IntList> COLOR_LIST_CODEC
- 
CODEC
- 
COLOR_LIST_STREAM_CODECprivate static final StreamCodec<io.netty.buffer.ByteBuf,it.unimi.dsi.fastutil.ints.IntList> COLOR_LIST_STREAM_CODEC
- 
STREAM_CODEC
- 
CUSTOM_COLOR_NAME
 
- 
- 
Constructor Details- 
FireworkExplosionpublic 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 aFireworkExplosionrecord class.- Parameters:
- shape- the value for the- shaperecord component
- colors- the value for the- colorsrecord component
- fadeColors- the value for the- fadeColorsrecord component
- hasTrail- the value for the- hasTrailrecord component
- hasTwinkle- the value for the- hasTwinklerecord component
 
 
- 
- 
Method Details- 
addToTooltippublic void addToTooltip(Item.TooltipContext p_341341_, Consumer<Component> p_331404_, TooltipFlag p_330365_) - Specified by:
- addToTooltipin interface- TooltipProvider
 
- 
addShapeNameTooltip
- 
addAdditionalTooltip
- 
appendColorsprivate static Component appendColors(MutableComponent p_331806_, it.unimi.dsi.fastutil.ints.IntList p_330350_) 
- 
getColorName
- 
withFadeColors
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 '=='.
- 
shapeReturns the value of theshaperecord component.- Returns:
- the value of the shaperecord component
 
- 
colorspublic it.unimi.dsi.fastutil.ints.IntList colors()Returns the value of thecolorsrecord component.- Returns:
- the value of the colorsrecord component
 
- 
fadeColorspublic it.unimi.dsi.fastutil.ints.IntList fadeColors()Returns the value of thefadeColorsrecord component.- Returns:
- the value of the fadeColorsrecord component
 
- 
hasTrailpublic boolean hasTrail()Returns the value of thehasTrailrecord component.- Returns:
- the value of the hasTrailrecord component
 
- 
hasTwinklepublic boolean hasTwinkle()Returns the value of thehasTwinklerecord component.- Returns:
- the value of the hasTwinklerecord component
 
 
-