Skip to content

feat: allow to pass in relative paths for input files and add assets file - #1

Merged
realBritakee merged 2 commits into
realBritakee:mainfrom
codyadam:fix-assets
Jan 25, 2026
Merged

feat: allow to pass in relative paths for input files and add assets file#1
realBritakee merged 2 commits into
realBritakee:mainfrom
codyadam:fix-assets

Conversation

@codyadam

Copy link
Copy Markdown
Contributor

Issue

The gradlew runServer doesn't pass in the Assets.zip file as a parameter, which causes the server to crash.

Solution

I added a property in the build.gradle.kts to allow the user to pass in the Assets.zip location so it's used.

Bonus

I also made the two fields be able to accept either URLs, relative, or absolute paths.

@Joshi234

Joshi234 commented Jan 13, 2026

Copy link
Copy Markdown

I can confirm this works, probably the easiest wat to fix this as you need authentication for the download, authentication could be something for down the road.
To actually make this work the plugin dir needs to be changed to "mods" instead of "plugins"

Edit:
Also the dependency needs to be updated to the serverjar aswell so you have the actual api

@Joshi234

Copy link
Copy Markdown

Its working:
image

@codyadam

Copy link
Copy Markdown
Contributor Author

@Joshi234 I didn't really understand what you meant, could you rephrase ?

@DanielNovaesDias

DanielNovaesDias commented Jan 13, 2026

Copy link
Copy Markdown

I believe the only observation he had is that the "plugins" folder where the user's plugin is being copied to should be named mods instead for it to work with the hytale jar. It doesn't have anything to do with the PR tho.

@Joshi234

Joshi234 commented Jan 14, 2026

Copy link
Copy Markdown

I believe the only observation he had is that the "plugins" folder where the user's plugin is being copied to should be named mods instead for it to work with the hytale jar. It doesn't have anything to do with the PR tho.

Yeah that and the server jar needs to be set as dependency in the gradle so you can actually write plugins

dependencies {
    // Hytale Server API (provided by server at runtime)
    compileOnly(files("./HytaleServer.jar"))

    // Common dependencies (will be bundled in JAR)
    implementation("com.google.code.gson:gson:2.10.1")
    implementation("org.jetbrains:annotations:24.1.0")

    // Test dependencies
    testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
    testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

in build.gradle.kts
andin RunHytalePlugin.kt

fun run() {
        // Create directories
        val runDir = File(project.projectDir, "run").apply { mkdirs() }
        val pluginsDir = File(runDir, "mods").apply { mkdirs() }
        val jarFile = File(runDir, "server.jar")

While thoes fixed doen't relate directly to your pr, it would be nice if you could commit them to make this template usable with this pr

Adjusted the paths in build.gradle.kts to reference the correct locations for HytaleServer.jar and Assets.zip. Updated README to reflect changes in the server's mods folder instead of plugins folder for clarity.
@codyadam

Copy link
Copy Markdown
Contributor Author

I updated the PR with the renaming to mods folder

Comment thread README.md
// Hytale API (provided by server)
compileOnly(files("libs/hytale-server.jar"))
compileOnly(files("./HytaleServer.jar"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it expected to have ./HytaleServer.jar here while in other places it is at ./libs/HytaleServer.jar ?

@jeanniardJ jeanniardJ Jan 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out that in the build.gradle.kts file, there is the following path: "./libs/HytaleServer.jar".

@realBritakee
realBritakee merged commit 1cf2fe3 into realBritakee:main Jan 25, 2026
2 checks passed
mustafa-5500 pushed a commit to mustafa-5500/Hytale-template-plugin that referenced this pull request Feb 1, 2026
)

* Enhance build configuration and dependencies for Hytale plugin to use HytaleServer.jar from official maven repository. Added permissions in workflows to allow github action to create new releases.

* Remove unused database driver dependencies

Removed unused database driver dependencies.

---------

Co-authored-by: Federico Leiva <fl8176@gmail.com>
Co-authored-by: InvBoy <49959270+FedericoLeiva12@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants