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 Summary
-
Field Summary
Modifier 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.IntList
The field for thecolors
record component.private static final Component
static final FireworkExplosion
private final it.unimi.dsi.fastutil.ints.IntList
The field for thefadeColors
record component.private final boolean
The field for thehasTrail
record component.private final boolean
The field for thehasTwinkle
record component.private final FireworkExplosion.Shape
The field for theshape
record component.static final StreamCodec
<io.netty.buffer.ByteBuf, FireworkExplosion> -
Constructor Summary
ConstructorDescriptionFireworkExplosion
(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 aFireworkExplosion
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalTooltip
(Consumer<Component> p_331797_) void
addShapeNameTooltip
(Consumer<Component> p_331419_) void
addToTooltip
(Item.TooltipContext p_328877_, Consumer<Component> p_333224_, TooltipFlag p_335960_) private static Component
appendColors
(MutableComponent p_333538_, it.unimi.dsi.fastutil.ints.IntList p_333652_) it.unimi.dsi.fastutil.ints.IntList
colors()
Returns the value of thecolors
record component.final boolean
Indicates whether some other object is "equal to" this one.it.unimi.dsi.fastutil.ints.IntList
Returns the value of thefadeColors
record component.private static Component
getColorName
(int p_333961_) final int
hashCode()
Returns a hash code value for this object.boolean
hasTrail()
Returns the value of thehasTrail
record component.boolean
Returns the value of thehasTwinkle
record component.shape()
Returns the value of theshape
record component.final String
toString()
Returns a string representation of this record class.withFadeColors
(it.unimi.dsi.fastutil.ints.IntList p_330299_)
-
Field Details
-
shape
The field for theshape
record component. -
colors
private final it.unimi.dsi.fastutil.ints.IntList colorsThe field for thecolors
record component. -
fadeColors
private final it.unimi.dsi.fastutil.ints.IntList fadeColorsThe field for thefadeColors
record component. -
hasTrail
private final boolean hasTrailThe field for thehasTrail
record component. -
hasTwinkle
private final boolean hasTwinkleThe field for thehasTwinkle
record component. -
DEFAULT
-
COLOR_LIST_CODEC
public static final com.mojang.serialization.Codec<it.unimi.dsi.fastutil.ints.IntList> COLOR_LIST_CODEC -
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
-
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 aFireworkExplosion
record class.- Parameters:
shape
- the value for theshape
record componentcolors
- the value for thecolors
record componentfadeColors
- the value for thefadeColors
record componenthasTrail
- the value for thehasTrail
record componenthasTwinkle
- the value for thehasTwinkle
record component
-
-
Method Details
-
addToTooltip
public void addToTooltip(Item.TooltipContext p_328877_, Consumer<Component> p_333224_, TooltipFlag p_335960_) - Specified by:
addToTooltip
in interfaceTooltipProvider
-
addShapeNameTooltip
-
addAdditionalTooltip
-
appendColors
private static Component appendColors(MutableComponent p_333538_, it.unimi.dsi.fastutil.ints.IntList p_333652_) -
getColorName
-
withFadeColors
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
shape
Returns the value of theshape
record component.- Returns:
- the value of the
shape
record component
-
colors
public it.unimi.dsi.fastutil.ints.IntList colors()Returns the value of thecolors
record component.- Returns:
- the value of the
colors
record component
-
fadeColors
public it.unimi.dsi.fastutil.ints.IntList fadeColors()Returns the value of thefadeColors
record component.- Returns:
- the value of the
fadeColors
record component
-
hasTrail
public boolean hasTrail()Returns the value of thehasTrail
record component.- Returns:
- the value of the
hasTrail
record component
-
hasTwinkle
public boolean hasTwinkle()Returns the value of thehasTwinkle
record component.- Returns:
- the value of the
hasTwinkle
record component
-