updated the template so it finds Hytale even when it isn’t in the default path

This commit is contained in:
Britakee
2026-02-18 08:57:15 +01:00
parent be9968c345
commit b6a2a9d515
2 changed files with 6 additions and 5 deletions

View File

@@ -9,8 +9,9 @@ import org.gradle.internal.os.OperatingSystem
ext { ext {
if (project.hasProperty('hytale_home')) { if (project.hasProperty('hytale_home')) {
hytaleHome = project.findProperty('hytale_home') hytaleHome = project.findProperty('hytale_home')
} } else if (System.getenv('HYTALE_HOME')) {
else { hytaleHome = System.getenv('HYTALE_HOME')
} else {
def os = OperatingSystem.current() def os = OperatingSystem.current()
if (os.isWindows()) { if (os.isWindows()) {
hytaleHome = "${System.getProperty("user.home")}/AppData/Roaming/Hytale" hytaleHome = "${System.getProperty("user.home")}/AppData/Roaming/Hytale"
@@ -27,8 +28,8 @@ ext {
} }
} }
def hytaleHomePath = project.findProperty('hytaleHome') def hytaleHomePath = ext.has('hytaleHome') ? hytaleHome : null
def hasHytaleHome = hytaleHomePath && file(hytaleHomePath).exists() def hasHytaleHome = (hytaleHomePath != null) && file(hytaleHomePath).exists()
if (!hasHytaleHome) { if (!hasHytaleHome) {
logger.lifecycle("Hytale install not detected; run configs that launch the server will be skipped. Set -Phytale_home=/path/to/Hytale to enable them.") logger.lifecycle("Hytale install not detected; run configs that launch the server will be skipped. Set -Phytale_home=/path/to/Hytale to enable them.")
} }

View File

@@ -1,7 +1,7 @@
{ {
"Group": "Example", "Group": "Example",
"Name": "ExamplePlugin", "Name": "ExamplePlugin",
"Version": "0.0.3", "Version": "0.0.2",
"Description": "An example plugin for HyTale!", "Description": "An example plugin for HyTale!",
"Authors": [ "Authors": [
{ {