Record Class CelebrationDefinition
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.celebration.CelebrationDefinition
- Record Components:
id- the stable ID cosmetics ownership is stored undername- the display name, in Zentrix's colour formaticon- the menu icon as written: a material name or a custom item identifieraudience- who sees and hears itcomponentCount- how many sound, particle and firework effects it plays; 0 plays nothingdurationTicks- how long it plays once started
public record CelebrationDefinition(@NotNull String id, @NotNull String name, @NotNull String icon, @NotNull CelebrationDefinition.Audience audience, int componentCount, int durationTicks)
extends Record
One victory celebration of
content/cosmetics/celebrations.yml. A snapshot.- Since:
- 1.8.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWho sees and hears a celebration. -
Constructor Summary
ConstructorsConstructorDescriptionCelebrationDefinition(@NotNull String id, @NotNull String name, @NotNull String icon, @NotNull CelebrationDefinition.Audience audience, int componentCount, int durationTicks) Creates an instance of aCelebrationDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull CelebrationDefinition.Audienceaudience()Returns the value of theaudiencerecord component.intReturns the value of thecomponentCountrecord component.intReturns the value of thedurationTicksrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Stringicon()Returns the value of theiconrecord component.@NotNull Stringid()Returns the value of theidrecord component.@NotNull Stringname()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CelebrationDefinition
public CelebrationDefinition(@NotNull @NotNull String id, @NotNull @NotNull String name, @NotNull @NotNull String icon, @NotNull @NotNull CelebrationDefinition.Audience audience, int componentCount, int durationTicks) Creates an instance of aCelebrationDefinitionrecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componenticon- the value for theiconrecord componentaudience- the value for theaudiencerecord componentcomponentCount- the value for thecomponentCountrecord componentdurationTicks- the value for thedurationTicksrecord component
-
-
Method Details
-
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 '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
audience
Returns the value of theaudiencerecord component.- Returns:
- the value of the
audiencerecord component
-
componentCount
public int componentCount()Returns the value of thecomponentCountrecord component.- Returns:
- the value of the
componentCountrecord component
-
durationTicks
public int durationTicks()Returns the value of thedurationTicksrecord component.- Returns:
- the value of the
durationTicksrecord component
-