Interface ServerPackHandlerBase

  • All Implemented Interfaces:
    de.griefed.serverpackcreator.api.plugins.BaseInformation , de.griefed.serverpackcreator.api.plugins.ExtensionInformation , org.pf4j.ExtensionPoint

    
    public interface ServerPackHandlerBase
     implements ExtensionInformation
                        

    The shape every generation hook shares. Sealed, so the hook a plugin implements is one of PreGenExtension, PreZipExtension or PostGenExtension — which of the three decides when run fires, not what it is handed.

    Author:

    Griefed

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit run(VersionMeta versionMeta, Utilities utilities, ApiProperties apiProperties, PackConfig packConfig, String destination, Optional<CommentedConfig> pluginConfig, ArrayList<CommentedConfig> packSpecificConfigs) Does this hook's work on the server pack at destination, at the moment its own interface names.
      • Methods inherited from class de.griefed.serverpackcreator.api.plugins.ExtensionInformation

        getExtensionId
      • Methods inherited from class de.griefed.serverpackcreator.api.plugins.BaseInformation

        getAuthor, getDescription, getName, getVersion
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • run

         abstract Unit run(VersionMeta versionMeta, Utilities utilities, ApiProperties apiProperties, PackConfig packConfig, String destination, Optional<CommentedConfig> pluginConfig, ArrayList<CommentedConfig> packSpecificConfigs)

        Does this hook's work on the server pack at destination, at the moment its own interface names.

        Called once per generation by ApiPlugins.runPreGenExtensions, runPreZipExtensions or runPostGenExtensions, all three of which ServerPackHandler.run drives in that order: before any file is gathered, after they are gathered but before the ZIP is written, and after the pack is finished. destination is a real directory on disk at every one of those points, so a hook may add to it or read it — a PreZip hook writing there still lands inside the archive, a PostGen hook does not. Returning normally is the only success signal — the host catches ExtensionException, Exception and Error alike and logs them against this plugin in plugins.log, so a hook cannot fail a generation and a silent one is indistinguishable from one that did nothing.

        Parameters:
        versionMeta - Instance of VersionMeta so you can work with available Minecraft, Forge, Fabric, LegacyFabric and Quilt versions.
        utilities - Instance of Utilities commonly used across ServerPackCreator.
        apiProperties - Instance of ApiProperties as ServerPackCreator itself uses it.
        packConfig - Instance of PackConfig for a given server pack.
        destination - String.
        pluginConfig - Configuration for this plugin, conveniently provided by ServerPackCreator.
        packSpecificConfigs - Modpack and server pack specific configurations for this plugin, conveniently provided by ServerPackCreator.