Record Class CosmeticType
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.cosmetics.CosmeticType
- Record Components:
key- the type's keyname- the display name, in Zentrix's colour formatdescription- the description lines, in Zentrix's colour format; empty for built-in ones, whose description is in the locale fileicon- the icon of its tile in the cosmetics menu; a copydefaultId- the cosmetic used by players who chose none, or null when there is nonesource- the name of the plugin that provides it,Zentrixfor built-in onesavailable- whether it can be used on this server; Zentrix's gliders and cage designs are not part of the Free edition
public record CosmeticType(@NotNull CosmeticTypeKey key, @NotNull String name, @NotNull List<String> description, @NotNull org.bukkit.inventory.ItemStack icon, @Nullable String defaultId, @NotNull String source, boolean available)
extends Record
A kind of cosmetic as the cosmetics menu shows it: one of Zentrix's own categories or one an
addon registered. A snapshot.
- Since:
- 1.11.0
-
Constructor Summary
ConstructorsConstructorDescriptionCosmeticType(@NotNull CosmeticTypeKey key, @NotNull String name, @NotNull List<String> description, @NotNull org.bukkit.inventory.ItemStack icon, @Nullable String defaultId, @NotNull String source, boolean available) Creates an instance of aCosmeticTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theavailablerecord component.@Nullable StringReturns the value of thedefaultIdrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull Optional<CosmeticCategory> The built-in category this is; empty for an addon's type.The cosmetic used by players who chose none, when there is one.final inthashCode()Returns a hash code value for this object.@NotNull org.bukkit.inventory.ItemStackicon()A copy of the icon.booleanWhether Zentrix itself provides it.@NotNull CosmeticTypeKeykey()Returns the value of thekeyrecord component.@NotNull Stringname()Returns the value of thenamerecord component.@NotNull Stringsource()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CosmeticType
public CosmeticType(@NotNull @NotNull CosmeticTypeKey key, @NotNull @NotNull String name, @NotNull @NotNull List<String> description, @NotNull @NotNull org.bukkit.inventory.ItemStack icon, @Nullable @Nullable String defaultId, @NotNull @NotNull String source, boolean available) Creates an instance of aCosmeticTyperecord class.- Parameters:
key- the value for thekeyrecord componentname- the value for thenamerecord componentdescription- the value for thedescriptionrecord componenticon- the value for theiconrecord componentdefaultId- the value for thedefaultIdrecord componentsource- the value for thesourcerecord componentavailable- the value for theavailablerecord component
-
-
Method Details
-
icon
@NotNull public @NotNull org.bukkit.inventory.ItemStack icon()A copy of the icon. -
getDefaultId
The cosmetic used by players who chose none, when there is one. -
getCategory
The built-in category this is; empty for an addon's type. -
isBuiltIn
public boolean isBuiltIn()Whether Zentrix itself provides it. -
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 '=='. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
defaultId
Returns the value of thedefaultIdrecord component.- Returns:
- the value of the
defaultIdrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
available
public boolean available()Returns the value of theavailablerecord component.- Returns:
- the value of the
availablerecord component
-