Class ModuleInfo

java.lang.Object
ua.mcchickenstudio.opencreative.coding.modules.ModuleInfo

public class ModuleInfo extends Object
  • Constructor Details

    • ModuleInfo

      public ModuleInfo(@NotNull @NotNull Module module)
  • Method Details

    • getDisplayName

      @NotNull public @NotNull String getDisplayName()
    • setDisplayName

      public void setDisplayName(String name)
      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

      @NotNull public @NotNull String getDescription()
    • setDescription

      public void setDescription(String description)
      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

      public boolean wasDownloadedBefore(@NotNull @NotNull Planet planet)
    • addDownload

      public void addDownload(@NotNull @NotNull Planet planet)
      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.