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
    dependsOn(@NonNull String... taskName)
    Adds the name of the prerequisite build task using a string identifier.
    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.ListProperty<String>
    The names of the tasks 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 java.lang.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
    • dependsOn

      public void dependsOn(@NonNull 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(@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
    • getDependsOn

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