Class ModuleInfo
java.lang.Object
ua.mcchickenstudio.opencreative.coding.modules.ModuleInfo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddDislike(@NotNull org.bukkit.entity.Player player) voidaddDownload(@NotNull Planet planet) Marks planet as module downloader.booleanaddLike(@NotNull org.bukkit.entity.Player player) net.kyori.adventure.text.ComponentReturns text component of display name, that can be used in item stacks or texts.long@NotNull String@NotNull Stringint@NotNull org.bukkit.inventory.ItemStackgetIcon()intbooleanisPublic()voidsetDescription(String description) Sets new description of module, that will be displayed in worlds browser menu.voidsetDisplayName(String name) Sets new display name of module, that will be displayed in modules browser menu.voidsetIcon(org.bukkit.inventory.ItemStack itemStack) Sets new item stack as module's icon.voidsetPublic(boolean isPublic) voidvoidUpdates icon in asynchronous task.booleanwasDownloadedBefore(@NotNull Planet planet)
-
Constructor Details
-
ModuleInfo
-
-
Method Details
-
getDisplayName
-
setDisplayName
Sets new display name of module, that will be displayed in modules browser menu.- Parameters:
name- new display name.
-
displayName
public net.kyori.adventure.text.Component displayName()Returns text component of display name, that can be used in item stacks or texts.- Returns:
- display name of planet.
-
getDescription
-
setDescription
Sets new description of module, that will be displayed in worlds browser menu.- Parameters:
description- new description.
-
getIcon
@NotNull public @NotNull org.bukkit.inventory.ItemStack getIcon() -
setIcon
public void setIcon(org.bukkit.inventory.ItemStack itemStack) Sets new item stack as module's icon. Name, lore and enchantments will be removed from item.- Parameters:
itemStack- new icon.
-
isPublic
public boolean isPublic() -
setPublic
public void setPublic(boolean isPublic) -
getCreationTime
public long getCreationTime() -
getReputation
public int getReputation() -
getDownloads
public int getDownloads() -
updateIcon
public void updateIcon() -
wasDownloadedBefore
-
addDownload
Marks planet as module downloader.- Parameters:
planet- planet that has installed module.
-
addLike
public boolean addLike(@NotNull @NotNull org.bukkit.entity.Player player) -
addDislike
public boolean addDislike(@NotNull @NotNull org.bukkit.entity.Player player) -
updateIconAsync
public void updateIconAsync()Updates icon in asynchronous task. Used to not load the main thread.
-