Class PluginManifest

java.lang.Object
com.hypixel.hytale.common.plugin.PluginManifest

public class PluginManifest extends Object
Represents the manifest of a plugin, including the name, version, authors and more.
  • Field Details

  • Constructor Details

    • PluginManifest

      public PluginManifest()
      An empty constructor for a PluginManifest instance.

      Used by the affiliated codec to instantiate plugin manifest instances.

    • PluginManifest

      public PluginManifest(@Nonnull String group, @Nonnull String name, @Nonnull Semver version, @Nullable String description, @Nonnull List<AuthorInfo> authors, @Nullable String website, @Nullable String main, @Nonnull SemverRange serverVersion, @Nonnull Map<PluginIdentifier, SemverRange> dependencies, @Nonnull Map<PluginIdentifier, SemverRange> optionalDependencies, @Nonnull Map<PluginIdentifier, SemverRange> loadBefore, @Nonnull List<PluginManifest> subPlugins, boolean disabledByDefault)
      Default Constructor for a PluginManifest instance.
      Parameters:
      group - The group of the plugin.
      name - The name of the plugin.
      version - The version of the plugin.
      description - The plugins description.
      authors - Authors associated with the plugin.
      website - The website associated with the plugin.
      main - A path to the main class of the plugin.
      serverVersion - The server version required for the plugin.
      dependencies - Dependencies required for the plugin.
      optionalDependencies - Optional dependencies for the plugin.
      loadBefore - Plugins this plugin should load before (soft ordering).
      subPlugins - The manifests of sub-plugins for this plugin.
      disabledByDefault - Whether the plugin should be disabled by default.
  • Method Details

    • checkServerVersionCompatibility

      @Nonnull public static PluginManifest.ServerVersionCheck checkServerVersionCompatibility(@Nullable SemverRange range, @Nullable String serverVersionStr)
    • getGroup

      public String getGroup()
      Returns:
      the group identifier for the plugin.
    • getName

      public String getName()
      Returns:
      the name of the plugin.
    • getVersion

      public Semver getVersion()
      Returns:
      the semver version.
    • getDescription

      @Nullable public String getDescription()
      Returns:
      the description.
    • getAuthors

      @Nonnull public List<AuthorInfo> getAuthors()
      Returns:
      the list of authors of the plugin.
    • getWebsite

      @Nullable public String getWebsite()
      Returns:
      the website of the plugin, or null if not specified.
    • setGroup

      public void setGroup(@Nonnull String group)
      Sets the group of the plugin
      Parameters:
      group - the group to set
    • setName

      public void setName(@Nonnull String name)
      Sets the name of the plugin
      Parameters:
      name - the name to set
    • setVersion

      public void setVersion(@Nullable Semver version)
      Sets the version of the plugin
      Parameters:
      version - the version to set
    • setDescription

      public void setDescription(@Nullable String description)
      Sets the description of the plugin
      Parameters:
      description - the description to set
    • setAuthors

      public void setAuthors(@Nonnull List<AuthorInfo> authors)
      Sets the authors of the plugin
      Parameters:
      authors - the authors to set
    • setWebsite

      public void setWebsite(@Nullable String website)
      Sets the website of the plugin
      Parameters:
      website - the website to set
    • getMain

      @Nullable public String getMain()
      Returns:
      the main class of the plugin, or null if not specified.
    • getServerVersion

      public SemverRange getServerVersion()
      The server version range that this plugin is compatible with.
    • setServerVersion

      public void setServerVersion(@Nullable SemverRange serverVersion)
    • getDependencies

      @Nonnull public Map<PluginIdentifier, SemverRange> getDependencies()
      Returns:
      the map of dependencies required by this plugin.
    • getOptionalDependencies

      @Nonnull public Map<PluginIdentifier, SemverRange> getOptionalDependencies()
      Returns:
      the map of optional dependencies for this plugin.
    • getLoadBefore

      @Nonnull public Map<PluginIdentifier, SemverRange> getLoadBefore()
      Returns:
      the map of plugins this plugin should load before (soft ordering constraint).
    • isDisabledByDefault

      public boolean isDisabledByDefault()
      Returns:
      true if the plugin is disabled by default, false otherwise.
    • includesAssetPack

      public boolean includesAssetPack()
      Returns:
      true if the plugin includes an asset pack, false otherwise.
    • getSubPlugins

      @Nonnull public List<PluginManifest> getSubPlugins()
      Returns:
      a list of plugin manifests of the sub-plugins for this manifest.
    • inherit

      public void inherit(@Nonnull PluginManifest manifest)
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • corePlugin

      @Nonnull public static PluginManifest.CoreBuilder corePlugin(@Nonnull Class<?> pluginClass)
      Creates a new core builder instance for the provided plugin class
      Parameters:
      pluginClass - The class of the plugin that we are creating this core builder for
      Returns:
      the newly created core builder instance