Record Class FireworkEffect
java.lang.Object
java.lang.Record
net.minestom.server.item.firework.FireworkEffect
-
Constructor Summary
ConstructorDescriptionFireworkEffect
(boolean flicker, boolean trail, @NotNull FireworkEffectType type, @NotNull List<Color> colors, @NotNull List<Color> fadeColors) Creates an instance of aFireworkEffect
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound
Retrieves theFireworkEffect
as aNBTCompound
.colors()
Returns the value of thecolors
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefadeColors
record component.boolean
flicker()
Returns the value of theflicker
record component.static @NotNull FireworkEffect
fromCompound
(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound) Retrieves a firework effect from the givencompound
.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.boolean
trail()
Returns the value of thetrail
record component.@NotNull FireworkEffectType
type()
Returns the value of thetype
record 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 aFireworkEffect
record class.- Parameters:
flicker
- the value for theflicker
record componenttrail
- the value for thetrail
record componenttype
- the value for thetype
record componentcolors
- the value for thecolors
record componentfadeColors
- the value for thefadeColors
record 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 theFireworkEffect
as 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 theflicker
record component.- Returns:
- the value of the
flicker
record component
-
trail
public boolean trail()Returns the value of thetrail
record component.- Returns:
- the value of the
trail
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
colors
Returns the value of thecolors
record component.- Returns:
- the value of the
colors
record component
-
fadeColors
Returns the value of thefadeColors
record component.- Returns:
- the value of the
fadeColors
record component
-