Record Class FireworkEffect
java.lang.Object
java.lang.Record
net.minestom.server.item.firework.FireworkEffect
-
Constructor Summary
ConstructorsConstructorDescriptionFireworkEffect(boolean flicker, boolean trail, @NotNull FireworkEffectType type, @NotNull List<Color> colors, @NotNull List<Color> fadeColors) Creates an instance of aFireworkEffectrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompoundRetrieves theFireworkEffectas aNBTCompound.colors()Returns the value of thecolorsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefadeColorsrecord component.booleanflicker()Returns the value of theflickerrecord component.static @NotNull FireworkEffectfromCompound(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound) Retrieves a firework effect from the givencompound.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.booleantrail()Returns the value of thetrailrecord component.@NotNull FireworkEffectTypetype()Returns the value of thetyperecord component.
-
Constructor Details
-
FireworkEffect
public FireworkEffect(boolean flicker, boolean trail, @NotNull @NotNull FireworkEffectType type, @NotNull @NotNull List<Color> colors, @NotNull @NotNull List<Color> fadeColors) Creates an instance of aFireworkEffectrecord class.- Parameters:
flicker- the value for theflickerrecord componenttrail- the value for thetrailrecord componenttype- the value for thetyperecord componentcolors- the value for thecolorsrecord componentfadeColors- the value for thefadeColorsrecord component
-
-
Method Details
-
fromCompound
@NotNull public static @NotNull FireworkEffect fromCompound(@NotNull @NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound) Retrieves a firework effect from the givencompound.- Parameters:
compound- The NBT connection, which should be a fireworks effect.- Returns:
- A new created firework effect.
-
asCompound
@NotNull public @NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound asCompound()Retrieves theFireworkEffectas aNBTCompound.- Returns:
- The firework effect as a nbt compound.
-
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 '=='. -
flicker
public boolean flicker()Returns the value of theflickerrecord component.- Returns:
- the value of the
flickerrecord component
-
trail
public boolean trail()Returns the value of thetrailrecord component.- Returns:
- the value of the
trailrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
colors
Returns the value of thecolorsrecord component.- Returns:
- the value of the
colorsrecord component
-
fadeColors
Returns the value of thefadeColorsrecord component.- Returns:
- the value of the
fadeColorsrecord component
-