Class HytalePluginExtension

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

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(@NonNull org.gradle.api.file.ProjectLayout layout)
    Constructs a new HytalePluginExtension and sets default conventions.
  • Method Summary

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

    Methods inherited from class Object

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

    • HytalePluginExtension

      @Inject public HytalePluginExtension(@NonNull 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(@NonNull org.gradle.api.Action<? super ModExtension> action)
      Configures the server mods via an action.
      Parameters:
      action - configuration block for mods
    • environment

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

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

      public void dependsOnBuildTask(@NonNull TaskName taskName)
      Sets the name of the prerequisite build task using a predefined TaskName enum.

      This is the preferred method for standard Gradle tasks to ensure type safety and avoid typos in task identifiers.

      Parameters:
      taskName - the constant representing the target task
    • serverAddress

      public void serverAddress(@NonNull 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 @NonNull ModExtension getModExtension()
      Accesses the nested configuration for server mods.
      Returns:
      the nested mod configuration extension
    • getEnvironment

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

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

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

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

      public abstract @NonNull org.gradle.api.provider.Property<File> getAssets()
      File property for the server assets archive.
      Returns:
      the property containing the assets file
    • getServerDownloadUri

      public abstract @NonNull 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 @NonNull org.gradle.api.provider.Property<File> getServerJar()
      The primary executable JAR file for the server.
      Returns:
      the property containing the server JAR file
    • getServerJarMainClass

      public abstract @NonNull 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
    • getJvmArgs

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

      public abstract @NonNull 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 @NonNull 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 @NonNull 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
    • getDependsOnBuildTask

      public abstract @NonNull org.gradle.api.provider.Property<String> getDependsOnBuildTask()
      The name of the task that must be completed before the server runs.

      This property defines a dependency for the server execution pipeline. Usually, this points to a task like jar or build to ensure that the latest version of the project is compiled and packaged before the server starts.

      Returns:
      the property containing the name of the prerequisite build task