From f30d7b0b4987e6033ec1b4ea8834cedcdc79a0bb Mon Sep 17 00:00:00 2001 From: JustATortoise Date: Sat, 17 Jan 2026 02:21:02 -0600 Subject: [PATCH] Refactor Hytale asset paths with custom directory support Update paths for Hytale installation and assets based on custom directory settings. --- build.gradle.kts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5f8e9ab09..139d58fc1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,8 +7,21 @@ group = "com.example" version = "0.1.0" val javaVersion = 25 -val appData = System.getenv("APPDATA") ?: (System.getenv("HOME") + "/.var/app/com.hypixel.HytaleLauncher/data") -val hytaleAssets = file("$appData/Hytale/install/release/package/game/latest/Assets.zip") +// Only set 'customGameDirectory' if you changed your Hytale installation path from the default AppData path. +// Example: You have Hytale installed at "D:/My Games/Hytale/..." Set this variable to "D:/My Games" (exclude /Hytale/...) +var customGameDirectory = "" +var baseDirectoryPath = "" + +if (customGameDirectory == ""){ + // Base directory defaults to appData + baseDirectoryPath = System.getenv("APPDATA") ?: (System.getenv("HOME") + "/.var/app/com.hypixel.HytaleLauncher/data") +} +else{ + // Base directory is custom + baseDirectoryPath = customGameDirectory +} + +var hytaleAssets = file("$baseDirectoryPath/Hytale/install/release/package/game/latest/Assets.zip") repositories { @@ -61,7 +74,10 @@ tasks.named("processResources") { } hytale { - + // Sets 'gameDir' to customGameDirectory (if it's set) so that the "hytale-mod" plugin knows where the gameDir is for getting the HytaleServer.jar + if (customGameDirectory != ""){ + gameDir = "$customGameDirectory/Hytale" + } } tasks.withType {