Class CosmeticTypeDefinition
java.lang.Object
dev.itsharshxd.zentrix.api.cosmetics.CosmeticTypeDefinition
How an addon's cosmetic type shows in
/cosmetics and when it triggers. Immutable; build
one with builder(String) and register it with CosmeticsService.registerType(org.bukkit.plugin.Plugin, dev.itsharshxd.zentrix.api.cosmetics.CosmeticTypeDefinition, dev.itsharshxd.zentrix.api.cosmetics.CosmeticHandler).
CosmeticTypeDefinition hats = CosmeticTypeDefinition.builder("hats")
.name("&eHats")
.description(List.of("&fChoose the hat you wear", "&fin every match."))
.icon(new ItemStack(Material.LEATHER_HELMET))
.triggers(CosmeticMoment.GAME_START, CosmeticMoment.GAME_LEAVE)
.build();
- Since:
- 1.11.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull CosmeticTypeDefinition.BuilderStarts a type.The cosmetic used by players who chose none; empty when they have none.The description lines of its tile, in Zentrix's colour format.@NotNull org.bukkit.inventory.ItemStackgetIcon()A copy of its tile's icon.@NotNull StringgetKey()The type within the registering plugin's namespace.@NotNull StringgetName()The display name, in Zentrix's colour format.@NotNull Set<CosmeticMoment> The moments the type triggers at.booleanWhether its handler shows previews, so/cosmeticsoffers right-click to preview.booleanWhether/cosmeticsalso lists the cosmetics a player can neither use nor buy.
-
Method Details
-
builder
@NotNull public static @NotNull CosmeticTypeDefinition.Builder builder(@NotNull @NotNull String key) Starts a type.- Parameters:
key- the type within the registering plugin's namespace, such ashats:a-z,0-9,_and-. Ownership is stored under it, so keep it stable.
-
getKey
The type within the registering plugin's namespace. -
getName
The display name, in Zentrix's colour format. -
getDescription
The description lines of its tile, in Zentrix's colour format. -
getIcon
@NotNull public @NotNull org.bukkit.inventory.ItemStack getIcon()A copy of its tile's icon. -
getDefaultId
The cosmetic used by players who chose none; empty when they have none. -
getTriggers
The moments the type triggers at. -
isShowLocked
public boolean isShowLocked()Whether/cosmeticsalso lists the cosmetics a player can neither use nor buy. -
hasPreviews
public boolean hasPreviews()Whether its handler shows previews, so/cosmeticsoffers right-click to preview.
-