fix: update paths for Hytale server and assets in build configuration

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.
This commit is contained in:
Cody Adam
2026-01-14 10:28:58 +01:00
parent b7b84b47ba
commit 2e98ce8457
3 changed files with 21 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ A minimal, ready-to-use template for creating Hytale plugins with modern build t
**Java 25** - Latest Java features **Java 25** - Latest Java features
**ShadowJar** - Automatic dependency bundling **ShadowJar** - Automatic dependency bundling
**CI/CD Ready** - GitHub Actions workflow included **CI/CD Ready** - GitHub Actions workflow included
**Minimal Structure** - Only essential files, write your own code **Minimal Structure** - Only essential files, write your own code
--- ---
@@ -52,11 +52,13 @@ Your plugin JAR will be in: `build/libs/TemplatePlugin-1.0.0.jar`
When ready to customize, edit these files: When ready to customize, edit these files:
**`settings.gradle.kts`:** **`settings.gradle.kts`:**
```kotlin ```kotlin
rootProject.name = "your-plugin-name" rootProject.name = "your-plugin-name"
``` ```
**`gradle.properties`:** **`gradle.properties`:**
```properties ```properties
pluginGroup=com.yourname pluginGroup=com.yourname
pluginVersion=1.0.0 pluginVersion=1.0.0
@@ -64,6 +66,7 @@ pluginDescription=Your plugin description
``` ```
**`src/main/resources/manifest.json`:** **`src/main/resources/manifest.json`:**
```json ```json
{ {
"Group": "YourName", "Group": "YourName",
@@ -73,6 +76,7 @@ pluginDescription=Your plugin description
``` ```
**Rename the main plugin class:** **Rename the main plugin class:**
- Rename `src/main/java/com/example/templateplugin/TemplatePlugin.java` - Rename `src/main/java/com/example/templateplugin/TemplatePlugin.java`
- Update package name to match your `pluginGroup` - Update package name to match your `pluginGroup`
@@ -91,6 +95,7 @@ Your plugin JAR will be in: `build/libs/YourPluginName-1.0.0.jar`
### 5. Implement Your Plugin ### 5. Implement Your Plugin
Write your plugin code in `src/main/java/`: Write your plugin code in `src/main/java/`:
- Commands - Commands
- Event listeners - Event listeners
- Services - Services
@@ -110,9 +115,10 @@ gradlew.bat runServer
``` ```
This will: This will:
1. Download the Hytale server (cached for future runs) 1. Download the Hytale server (cached for future runs)
2. Build your plugin 2. Build your plugin
3. Copy it to the server's plugins folder 3. Copy it to the server's mods folder
4. Start the server with interactive console 4. Start the server with interactive console
--- ---
@@ -141,6 +147,7 @@ TemplatePlugin/
``` ```
**Note:** This is a minimal template. Create your own folder structure: **Note:** This is a minimal template. Create your own folder structure:
- `commands/` - For command implementations - `commands/` - For command implementations
- `listeners/` - For event listeners - `listeners/` - For event listeners
- `services/` - For business logic - `services/` - For business logic
@@ -198,11 +205,11 @@ Edit `build.gradle.kts`:
```kotlin ```kotlin
dependencies { dependencies {
// Hytale API (provided by server) // Hytale API (provided by server)
compileOnly(files("libs/hytale-server.jar")) compileOnly(files("./HytaleServer.jar"))
// Your dependencies (will be bundled) // Your dependencies (will be bundled)
implementation("com.google.code.gson:gson:2.10.1") implementation("com.google.code.gson:gson:2.10.1")
// Test dependencies // Test dependencies
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0") testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
} }
@@ -210,7 +217,7 @@ dependencies {
### Configuring Server Testing ### Configuring Server Testing
**Run Hytale Server** - A Gradle plugin to download and run a Hytale server for development and testing purposes. The server files will be located in the `run/` directory of the project. Before starting the server it will compile (shadowJar task) and copy the plugin jar to the server's `plugins/` folder. **Run Hytale Server** - A Gradle plugin to download and run a Hytale server for development and testing purposes. The server files will be located in the `run/` directory of the project. Before starting the server it will compile (shadowJar task) and copy the plugin jar to the server's `mods/` folder.
**Usage:** **Usage:**
@@ -233,6 +240,7 @@ gradlew.bat runServer
``` ```
**Features:** **Features:**
- ✅ Automatic server JAR download and caching - ✅ Automatic server JAR download and caching
- ✅ Compiles and deploys your plugin automatically - ✅ Compiles and deploys your plugin automatically
- ✅ Starts server with interactive console - ✅ Starts server with interactive console
@@ -242,6 +250,7 @@ gradlew.bat runServer
### Implementing Your Plugin ### Implementing Your Plugin
**Recommended folder structure:** **Recommended folder structure:**
``` ```
src/main/java/com/yourname/yourplugin/ src/main/java/com/yourname/yourplugin/
├── YourPlugin.java # Main class ├── YourPlugin.java # Main class
@@ -254,6 +263,7 @@ src/main/java/com/yourname/yourplugin/
``` ```
**See our documentation for examples:** **See our documentation for examples:**
- [Getting Started with Plugins](../Documentation/07-getting-started-with-plugins.md) - [Getting Started with Plugins](../Documentation/07-getting-started-with-plugins.md)
- [Advanced Plugin Patterns](../Documentation/12-advanced-plugin-patterns.md) - [Advanced Plugin Patterns](../Documentation/12-advanced-plugin-patterns.md)
- [Common Plugin Features](../Documentation/14-common-plugin-features.md) - [Common Plugin Features](../Documentation/14-common-plugin-features.md)

View File

@@ -15,7 +15,7 @@ repositories {
dependencies { dependencies {
// Hytale Server API (provided by server at runtime) // Hytale Server API (provided by server at runtime)
compileOnly(files("libs/hytale-server.jar")) compileOnly(files("./libs/HytaleServer.jar"))
// Common dependencies (will be bundled in JAR) // Common dependencies (will be bundled in JAR)
implementation("com.google.code.gson:gson:2.10.1") implementation("com.google.code.gson:gson:2.10.1")
@@ -28,8 +28,8 @@ dependencies {
// Configure server testing // Configure server testing
runHytale { runHytale {
jarUrl = "./HytaleServer.jar" jarUrl = "./libs/HytaleServer.jar"
assetsPath = "./Assets.zip" assetsPath = "./libs/Assets.zip"
} }
tasks { tasks {

View File

@@ -60,7 +60,7 @@ open class RunServerTask : DefaultTask() {
fun run() { fun run() {
// Create directories // Create directories
val runDir = File(project.projectDir, "run").apply { mkdirs() } val runDir = File(project.projectDir, "run").apply { mkdirs() }
val pluginsDir = File(runDir, "plugins").apply { mkdirs() } val pluginsDir = File(runDir, "mods").apply { mkdirs() }
val jarFile = File(runDir, "server.jar") val jarFile = File(runDir, "server.jar")
// Cache directory for downloaded server JARs // Cache directory for downloaded server JARs
@@ -107,7 +107,7 @@ open class RunServerTask : DefaultTask() {
// Copy server JAR to run directory // Copy server JAR to run directory
cachedJar.copyTo(jarFile, overwrite = true) cachedJar.copyTo(jarFile, overwrite = true)
// Copy plugin JAR to plugins folder // Copy plugin JAR to mods folder
project.tasks.findByName("shadowJar")?.outputs?.files?.firstOrNull()?.let { shadowJar -> project.tasks.findByName("shadowJar")?.outputs?.files?.firstOrNull()?.let { shadowJar ->
val targetFile = File(pluginsDir, shadowJar.name) val targetFile = File(pluginsDir, shadowJar.name)
shadowJar.copyTo(targetFile, overwrite = true) shadowJar.copyTo(targetFile, overwrite = true)