|
1 | | -# 🛠️ Hytale Plugin Template |
| 1 | +# Natural Regeneration |
2 | 2 |
|
3 | | -Welcome to the **Hytale Plugin Template**! This project is a pre-configured foundation for building **Java Plugins**. It streamlines the development process by handling classpath setup, server execution, and asset bundling. |
| 3 | +A Hytale server plugin that passively regenerates player health after not taking damage for a configurable period of time. |
4 | 4 |
|
5 | | -> **⚠️ Early Access Warning** |
6 | | -> Hytale is currently in Early Access. Features, APIs, and this template are subject to frequent changes. Please ensure you are using the latest version of the template for the best experience. |
| 5 | +## Features |
7 | 6 |
|
8 | | ---- |
| 7 | +- Automatic health regeneration after a delay period |
| 8 | +- Fully configurable via in-game commands |
| 9 | +- Persistent configuration saved to JSON |
| 10 | +- Optimized for server performance |
9 | 11 |
|
10 | | -## 📋 Prerequisites |
| 12 | +## How It Works |
11 | 13 |
|
12 | | -Before you begin, ensure your environment is ready: |
| 14 | +1. When a player takes damage, their regeneration timer resets |
| 15 | +2. After the configured delay (default: 10 seconds), health regeneration begins |
| 16 | +3. Health regenerates at the configured rate until the player reaches max health or takes damage again |
13 | 17 |
|
14 | | -* **Hytale Launcher**: Installed and updated. |
15 | | -* **Java 25 SDK**: Required for modern Hytale development. |
16 | | -* **IntelliJ IDEA**: (Community or Ultimate) Recommended for full feature support. |
| 18 | +## Commands |
17 | 19 |
|
18 | | ---- |
| 20 | +| Command | Description | |
| 21 | +|---------|-------------| |
| 22 | +| `/nr` | Shows help and available subcommands | |
| 23 | +| `/nr status` | Display current configuration | |
| 24 | +| `/nr toggle` | Enable or disable regeneration | |
| 25 | +| `/nr delay <seconds>` | Set delay before regeneration starts | |
| 26 | +| `/nr amount <hp>` | Set HP regenerated per tick | |
| 27 | +| `/nr interval <seconds>` | Set time between regeneration ticks | |
19 | 28 |
|
20 | | -## 🚀 Quick Start Installation |
| 29 | +**Aliases:** `/naturalregeneration`, `/naturalregen`, `/nr` |
21 | 30 |
|
22 | | -### 1. Initial Setup (Before Importing) |
| 31 | +## Configuration |
23 | 32 |
|
24 | | -To avoid IDE caching issues, configure these files **before** you open the project in IntelliJ: |
| 33 | +Configuration is automatically saved to `Server/Plugin/Config/NaturalRegeneration.json` |
25 | 34 |
|
26 | | -* **`settings.gradle`**: Set your unique project name. |
27 | | -```gradle |
28 | | -rootProject.name = 'MyAwesomePlugin' |
| 35 | +| Option | Default | Description | |
| 36 | +|--------|---------|-------------| |
| 37 | +| `Enabled` | `true` | Whether regeneration is active | |
| 38 | +| `DelaySeconds` | `10.0` | Seconds after damage before regen starts | |
| 39 | +| `AmountHP` | `1.0` | HP restored per regeneration tick | |
| 40 | +| `IntervalSeconds` | `1.0` | Seconds between regeneration ticks | |
29 | 41 |
|
30 | | -``` |
31 | | - |
32 | | - |
33 | | -* **`gradle.properties`**: Set your `maven_group` (e.g., `com.yourname`) and starting version. |
34 | | -* **`src/main/resources/manifest.json`**: Update your plugin metadata. |
35 | | -* **CRITICAL:** Ensure the `"Main"` property points exactly to your entry-point class. |
36 | | - |
37 | | - |
38 | | - |
39 | | -### 2. Importing the Project |
40 | | - |
41 | | -1. Open IntelliJ IDEA and select **Open**. |
42 | | -2. Navigate to the template folder and click **OK**. |
43 | | -3. Wait for the Gradle sync to finish. This will automatically download dependencies, create a `./run` folder, and generate the **HytaleServer** run configuration. |
44 | | - |
45 | | -### 3. Authenticating your Test Server |
46 | | - |
47 | | -You **must** authenticate your local server to connect to it: |
48 | | - |
49 | | -1. Launch the **HytaleServer** configuration in IDEA. |
50 | | -2. In the terminal, run: `auth login device`. |
51 | | -3. Follow the printed URL to log in via your Hytale account. |
52 | | -4. Once verified, run: `auth persistence Encrypted`. |
53 | | - |
54 | | ---- |
| 42 | +### Example Configuration |
55 | 43 |
|
56 | | -## 🎮 Developing & Testing |
57 | | - |
58 | | -### Running the Server |
59 | | - |
60 | | -If you do not see the **HytaleServer** run configuration in the top-right dropdown, click "Edit Configurations..." to unhide it. Press the **Green Play Button** to start, or the **Bug Icon** to start in Debug Mode to enable breakpoints. |
61 | | - |
62 | | -### Verifying the Setup |
63 | | - |
64 | | -1. Launch your standard Hytale Client. |
65 | | -2. Connect to `Local Server` (127.0.0.1). |
66 | | -3. Type `/test` in-game. If it returns your plugin version, everything is working! |
67 | | - |
68 | | -### Bundling Assets |
69 | | - |
70 | | -You can include models and textures by placing them in `src/main/resources/Common/` or `src/main/resources/Server/`. These are editable in real-time using the in-game **Asset Editor**. |
71 | | - |
72 | | ---- |
73 | | - |
74 | | -## 📦 Building your Plugin |
| 44 | +```json |
| 45 | +{ |
| 46 | + "Enabled": true, |
| 47 | + "DelaySeconds": 10.0, |
| 48 | + "AmountHP": 1.0, |
| 49 | + "IntervalSeconds": 1.0 |
| 50 | +} |
| 51 | +``` |
75 | 52 |
|
76 | | -To create a shareable `.jar` file for distribution: |
| 53 | +## Installation |
77 | 54 |
|
78 | | -1. Open the **Gradle Tab** on the right side of IDEA. |
79 | | -2. Navigate to `Tasks` -> `build` -> `build`. |
80 | | -3. Your compiled plugin will be in: `build/libs/your-plugin-name-1.0.0.jar`. |
| 55 | +1. Build the plugin JAR file |
| 56 | +2. Place the JAR in your server's `plugins` folder |
| 57 | +3. Start/restart the server |
| 58 | +4. Configure using in-game commands or edit the config file |
81 | 59 |
|
82 | | -To install it manually, drop the JAR into `%appdata%/Hytale/UserData/Mods/`. |
| 60 | +## Building |
83 | 61 |
|
84 | | ---- |
| 62 | +```bash |
| 63 | +./gradlew build |
| 64 | +``` |
85 | 65 |
|
86 | | -## 📚 Advanced Documentation |
| 66 | +The compiled JAR will be located in `build/libs/` |
87 | 67 |
|
88 | | -For detailed guides on commands, event listeners, and professional patterns, visit our full documentation: |
89 | | -👉 **[Hytale Modding Documentation](https://britakee-studios.gitbook.io/hytale-modding-documentation)** |
| 68 | +## Requirements |
90 | 69 |
|
91 | | ---- |
| 70 | +- Hytale Server (compatible version) |
92 | 71 |
|
93 | | -## 🆘 Troubleshooting |
| 72 | +## License |
94 | 73 |
|
95 | | -* **Sync Fails**: Check that your Project SDK is set to **Java 25** via `File > Project Structure`. |
96 | | -* **Cannot Connect**: Ensure you ran the `auth` commands in the server console. |
97 | | -* **Plugin Not Loading**: Double-check your `manifest.json` for typos in the `"Main"` class path. |
| 74 | +MIT License |
98 | 75 |
|
99 | | ---- |
| 76 | +## Author |
100 | 77 |
|
101 | | -**Need Help?** Visit our full guide here: **[Hytale Modding Documentation](https://britakee-studios.gitbook.io/hytale-modding-documentation)** |
| 78 | +Toskan4134 |
0 commit comments