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
Nested Classes -
Field Summary
FieldsModifier 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 Summary
ConstructorsConstructorDescriptionFireworkExplosion(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 Summary
Modifier 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
-
shape
The field for theshaperecord component. -
colors
private final it.unimi.dsi.fastutil.ints.IntList colorsThe field for thecolorsrecord component. -
fadeColors
private final it.unimi.dsi.fastutil.ints.IntList fadeColorsThe field for thefadeColorsrecord component. -
hasTrail
private final boolean hasTrailThe field for thehasTrailrecord component. -
hasTwinkle
private final boolean hasTwinkleThe field for thehasTwinklerecord 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 aFireworkExplosionrecord class.- Parameters:
shape- the value for theshaperecord componentcolors- the value for thecolorsrecord componentfadeColors- the value for thefadeColorsrecord componenthasTrail- the value for thehasTrailrecord componenthasTwinkle- the value for thehasTwinklerecord component
-
-
Method Details
-
addToTooltip
public void addToTooltip(Item.TooltipContext p_341341_, Consumer<Component> p_331404_, TooltipFlag p_330365_) - Specified by:
addToTooltipin interfaceTooltipProvider
-
addShapeNameTooltip
-
addAdditionalTooltip
-
appendColors
private static Component appendColors(MutableComponent p_331806_, it.unimi.dsi.fastutil.ints.IntList p_330350_) -
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 theshaperecord component.- Returns:
- the value of the
shaperecord component
-
colors
public it.unimi.dsi.fastutil.ints.IntList colors()Returns the value of thecolorsrecord component.- Returns:
- the value of the
colorsrecord component
-
fadeColors
public it.unimi.dsi.fastutil.ints.IntList fadeColors()Returns the value of thefadeColorsrecord component.- Returns:
- the value of the
fadeColorsrecord component
-
hasTrail
public boolean hasTrail()Returns the value of thehasTrailrecord component.- Returns:
- the value of the
hasTrailrecord component
-
hasTwinkle
public boolean hasTwinkle()Returns the value of thehasTwinklerecord component.- Returns:
- the value of the
hasTwinklerecord component
-