Class HytalePluginExtension

java.lang.Object
wtf.ranked.hytale.server.runner.HytalePluginExtension
All Implemented Interfaces:
Serializable

@NullMarked public abstract class HytalePluginExtension extends Object implements Serializable
Main configuration extension for the Hytale Boot plugin.

Defines paths for the server environment, download locations, and JVM arguments required to boot the server.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    HytalePluginExtension(org.gradle.api.Project project, org.gradle.api.file.ProjectLayout layout)
    Constructs a new HytalePluginExtension and sets default conventions.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dependsOn(String... taskName)
    Adds the name of the prerequisite build task using a string identifier.
    void
    environment(String identifier, Object value)
    Adds an environment variable to the server process.
    abstract org.gradle.api.file.RegularFileProperty
    File property for the server assets archive.
    abstract org.gradle.api.provider.ListProperty<String>
    The names of the tasks that must be completed before the server runs.
    abstract org.gradle.api.provider.Property<Duration>
    The maximum amount of time allowed for download operations.
    abstract org.gradle.api.file.DirectoryProperty
    Directory where server mods will be installed.
    abstract ModExtension
    Accesses the nested configuration for server mods.
    abstract org.gradle.api.provider.Property<Patchline>
    Returns the targeted patchline (e.g., RELEASE, SNAPSHOT) for the server.
    abstract org.gradle.api.file.DirectoryProperty
    Root directory for server execution.
    abstract org.gradle.api.provider.Property<InetSocketAddress>
    The InetSocketAddress to which the server will be bound.
    abstract org.gradle.api.file.DirectoryProperty
    Directory where the Hytale server files are located.
    abstract org.gradle.api.provider.Property<URI>
    URI used to download the server software.
    abstract org.gradle.api.provider.MapProperty<String,Object>
    Map of environment variables passed to the server process.
    abstract org.gradle.api.file.RegularFileProperty
    The primary executable JAR file for the server.
    abstract org.gradle.api.provider.Property<String>
    The entry point class name for the Hytale server.
    abstract org.gradle.api.provider.ListProperty<String>
    List of JVM arguments to pass to the server process.
    abstract org.gradle.api.provider.Property<OnlineMode>
    Property which allows to change the server online mode.
    void
    mods(org.gradle.api.Action<? super ModExtension> action)
    Configures the server mods via an action.
    void
    serverAddress(String host, int port)
    Sets the network address and port for the Hytale server.

    Methods inherited from class java.lang.Object

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

    • HytalePluginExtension

      @Inject public HytalePluginExtension(org.gradle.api.Project project, org.gradle.api.file.ProjectLayout layout)
      Constructs a new HytalePluginExtension and sets default conventions.
      Parameters:
      layout - the Gradle project layout used to resolve default paths
  • Method Details

    • mods

      public void mods(org.gradle.api.Action<? super ModExtension> action)
      Configures the server mods via an action.
      Parameters:
      action - configuration block for mods
    • environment

      public void environment(String identifier, Object value)
      Adds an environment variable to the server process.
      Parameters:
      identifier - variable name
      value - variable value
    • dependsOn

      public void dependsOn(String... taskName)
      Adds the name of the prerequisite build task using a string identifier.
      Parameters:
      taskName - the name of the task to depend on (e.g., "assemble")
    • serverAddress

      public void serverAddress(String host, int port)
      Sets the network address and port for the Hytale server.

      This is a convenience method that creates an InetSocketAddress and updates the getServerAddress() property.

      Parameters:
      host - the hostname or IP address to bind to (e.g., "0.0.0.0")
      port - the port number (e.g., 5520)
    • getModExtension

      public abstract ModExtension getModExtension()
      Accesses the nested configuration for server mods.
      Returns:
      the nested mod configuration extension
    • getServerEnvironment

      public abstract org.gradle.api.provider.MapProperty<String,Object> getServerEnvironment()
      Map of environment variables passed to the server process.
      Returns:
      the property containing environment variables
    • getServerDirectory

      public abstract org.gradle.api.file.DirectoryProperty getServerDirectory()
      Directory where the Hytale server files are located.
      Returns:
      the property containing the server directory
    • getRunDirectory

      public abstract org.gradle.api.file.DirectoryProperty getRunDirectory()
      Root directory for server execution.
      Returns:
      the property containing the run directory
    • getModDirectory

      public abstract org.gradle.api.file.DirectoryProperty getModDirectory()
      Directory where server mods will be installed.
      Returns:
      the property containing the mods directory
    • getAssets

      public abstract org.gradle.api.file.RegularFileProperty getAssets()
      File property for the server assets archive.
      Returns:
      the property containing the assets file
    • getServerDownloadUri

      public abstract org.gradle.api.provider.Property<URI> getServerDownloadUri()
      URI used to download the server software.
      Returns:
      the property containing the server download URI
    • getServerJar

      public abstract org.gradle.api.file.RegularFileProperty getServerJar()
      The primary executable JAR file for the server.
      Returns:
      the property containing the server JAR file
    • getServerJarMainClass

      public abstract org.gradle.api.provider.Property<String> getServerJarMainClass()
      The entry point class name for the Hytale server.
      Returns:
      the property containing the server main class name
    • getServerJvmArgs

      public abstract org.gradle.api.provider.ListProperty<String> getServerJvmArgs()
      List of JVM arguments to pass to the server process.
      Returns:
      the property containing the list of JVM arguments
    • getServerOnlineMode

      public abstract org.gradle.api.provider.Property<OnlineMode> getServerOnlineMode()
      Property which allows to change the server online mode.
      Returns:
      the property containing the server online mode
    • getServerAddress

      public abstract org.gradle.api.provider.Property<InetSocketAddress> getServerAddress()
      The InetSocketAddress to which the server will be bound.
      Returns:
      the property containing the server bind address
    • getDownloadTimeout

      public abstract org.gradle.api.provider.Property<Duration> getDownloadTimeout()
      The maximum amount of time allowed for download operations.

      This timeout is applied when downloading server software or assets to prevent the build process from hanging indefinitely due to network issues.

      Returns:
      the property containing the download timeout duration
    • getDependsOn

      public abstract org.gradle.api.provider.ListProperty<String> getDependsOn()
      The names of the tasks that must be completed before the server runs.

      These properties define dependencies for the server execution pipeline. Usually, this includes tasks like jar or shadowJar to ensure that the latest version of the project is compiled and packaged before the server starts.

      Returns:
      the property containing the list of prerequisite build tasks
    • getPatchline

      public abstract org.gradle.api.provider.Property<Patchline> getPatchline()
      Returns the targeted patchline (e.g., RELEASE, SNAPSHOT) for the server.
      Returns:
      a property containing the Patchline