Init
This commit is contained in:
14
content/getting-started/_index.en.md
Normal file
14
content/getting-started/_index.en.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: Getting Started
|
||||
type: docs
|
||||
weight: 1
|
||||
---
|
||||
|
||||
Welcome to Hytale plugin development! This section will guide you through setting up your development environment and creating your first plugin.
|
||||
|
||||
{{< cards >}}
|
||||
{{< card link="prerequisites" title="Prerequisites" subtitle="Set up Java 25, Gradle, and your IDE" >}}
|
||||
{{< card link="building-and-running" title="Building & Running" subtitle="Build your plugin and deploy it" >}}
|
||||
{{< card link="creating-a-plugin" title="Creating a Plugin" subtitle="Project structure and manifest.json" >}}
|
||||
{{< card link="plugin-lifecycle" title="Plugin Lifecycle" subtitle="Understanding setup, start, and shutdown" >}}
|
||||
{{< /cards >}}
|
||||
14
content/getting-started/_index.fr.md
Normal file
14
content/getting-started/_index.fr.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: Premiers Pas
|
||||
type: docs
|
||||
weight: 1
|
||||
---
|
||||
|
||||
Bienvenue dans le développement de plugins Hytale ! Cette section vous guidera dans la configuration de votre environnement de développement et la création de votre premier plugin.
|
||||
|
||||
{{< cards >}}
|
||||
{{< card link="prerequisites" title="Prérequis" subtitle="Configurer Java 25, Gradle et votre IDE" >}}
|
||||
{{< card link="building-and-running" title="Build et Exécution" subtitle="Compiler et déployer votre plugin" >}}
|
||||
{{< card link="creating-a-plugin" title="Créer un Plugin" subtitle="Structure du projet et manifest.json" >}}
|
||||
{{< card link="plugin-lifecycle" title="Cycle de Vie" subtitle="Comprendre setup, start et shutdown" >}}
|
||||
{{< /cards >}}
|
||||
246
content/getting-started/building-and-running.en.md
Normal file
246
content/getting-started/building-and-running.en.md
Normal file
@@ -0,0 +1,246 @@
|
||||
---
|
||||
title: Building and Running
|
||||
type: docs
|
||||
weight: 2
|
||||
---
|
||||
|
||||
This guide covers how to set up your development environment, build your plugin, and deploy it to a Hytale server.
|
||||
|
||||
## Quick Start with example-mod
|
||||
|
||||
The easiest way to start plugin development is using the [example-mod](https://github.com/hytale-france/example-mod) template which includes an automated setup script.
|
||||
|
||||
### 1. Clone the Repository
|
||||
|
||||
```bash
|
||||
git clone https://github.com/hytale-france/example-mod.git
|
||||
cd example-mod
|
||||
```
|
||||
|
||||
Or download the latest release from [GitHub Releases](https://github.com/hytale-france/example-mod/releases).
|
||||
|
||||
### 2. Download Tools (Once)
|
||||
|
||||
Download the required tools (hytale-downloader and CFR decompiler):
|
||||
|
||||
```bash
|
||||
./setup.sh --download
|
||||
```
|
||||
|
||||
This creates a `.bin/` directory with:
|
||||
- `hytale-downloader-*` - Official Hytale server downloader
|
||||
- `cfr-0.152.jar` - Java decompiler for reference sources
|
||||
|
||||
### 3. Download the Server
|
||||
|
||||
Download and extract the Hytale server:
|
||||
|
||||
```bash
|
||||
./setup.sh --setup
|
||||
```
|
||||
|
||||
The server will be available in `server/Server/HytaleServer.jar`.
|
||||
|
||||
### 4. Generate Reference Sources (Optional)
|
||||
|
||||
Decompile the server JAR to get API reference sources:
|
||||
|
||||
```bash
|
||||
./setup.sh --decompile
|
||||
```
|
||||
|
||||
This creates `src-ref/` with decompiled Java sources for IDE autocompletion and documentation.
|
||||
|
||||
## Project Structure
|
||||
|
||||
After setup, your project will look like this:
|
||||
|
||||
```
|
||||
example-mod/
|
||||
├── app/
|
||||
│ ├── src/main/java/org/example/
|
||||
│ │ └── ExamplePlugin.java
|
||||
│ ├── src/main/resources/
|
||||
│ │ └── manifest.json
|
||||
│ └── build.gradle.kts
|
||||
├── server/
|
||||
│ ├── Server/
|
||||
│ │ └── HytaleServer.jar
|
||||
│ └── Assets.zip
|
||||
├── src-ref/ # Decompiled reference sources
|
||||
├── .bin/ # Downloaded tools
|
||||
├── setup.sh # Setup automation script
|
||||
├── build.gradle.kts
|
||||
├── settings.gradle.kts
|
||||
└── gradlew
|
||||
```
|
||||
|
||||
## Building the Plugin
|
||||
|
||||
### 1. Build with Gradle
|
||||
|
||||
```bash
|
||||
# On Linux/macOS
|
||||
./gradlew build
|
||||
|
||||
# On Windows
|
||||
gradlew.bat build
|
||||
```
|
||||
|
||||
### 2. Locate the Built JAR
|
||||
|
||||
After a successful build, your plugin JAR will be in:
|
||||
|
||||
```
|
||||
app/build/libs/ExamplePlugin-1.0.0.jar
|
||||
```
|
||||
|
||||
## Running the Server
|
||||
|
||||
### 1. Initial Server Setup
|
||||
|
||||
Start the server for the first time:
|
||||
|
||||
```bash
|
||||
cd server
|
||||
java -jar Server/HytaleServer.jar --assets Assets.zip
|
||||
```
|
||||
|
||||
### 2. Authenticate
|
||||
|
||||
Once the server console is ready, run the authentication command:
|
||||
|
||||
```
|
||||
/auth login device
|
||||
```
|
||||
|
||||
Follow the instructions to authenticate with your Hytale account.
|
||||
|
||||
{{< callout type="warning" >}}
|
||||
**Authentication Required:** If no server tokens are configured, you will see a warning at startup:
|
||||
```
|
||||
No server tokens configured. Use /auth login to authenticate.
|
||||
```
|
||||
You must authenticate before players can join the server in non-singleplayer mode.
|
||||
{{< /callout >}}
|
||||
|
||||
### 3. Stop the Server
|
||||
|
||||
After authentication, you can stop the server:
|
||||
|
||||
- **Linux/macOS:** Press `Ctrl+C`
|
||||
- **Windows:** Press `Ctrl+C` or close the terminal
|
||||
|
||||
## Deploying Your Plugin
|
||||
|
||||
### 1. Copy the JAR
|
||||
|
||||
Copy the built JAR to the `mods` folder:
|
||||
|
||||
```bash
|
||||
cp app/build/libs/ExamplePlugin-1.0.0.jar server/mods/
|
||||
```
|
||||
|
||||
### 2. Start the Server
|
||||
|
||||
```bash
|
||||
cd server
|
||||
java -jar Server/HytaleServer.jar --assets Assets.zip
|
||||
```
|
||||
|
||||
### 3. Verify Loading
|
||||
|
||||
You should see your plugin loading in the console:
|
||||
|
||||
```
|
||||
[INFO] [PluginManager] Loading pending plugins from directory: mods
|
||||
[INFO] [PluginManager] - org.example:ExamplePlugin from path ExamplePlugin-1.0.0.jar
|
||||
```
|
||||
|
||||
## Updating the Server
|
||||
|
||||
When a new Hytale version is released:
|
||||
|
||||
```bash
|
||||
./setup.sh --update
|
||||
```
|
||||
|
||||
This will download the latest server version and update your installation.
|
||||
|
||||
## Common Issues
|
||||
|
||||
### Java Version Mismatch
|
||||
|
||||
{{< callout type="error" >}}
|
||||
**Error:** `Unsupported class file major version 69`
|
||||
{{< /callout >}}
|
||||
|
||||
Ensure you're using Java 25:
|
||||
|
||||
```bash
|
||||
java --version
|
||||
```
|
||||
|
||||
### Manifest Not Found
|
||||
|
||||
{{< callout type="error" >}}
|
||||
**Error:** `Failed to load manifest file!`
|
||||
{{< /callout >}}
|
||||
|
||||
Make sure `manifest.json` is in `src/main/resources/` and included in the JAR.
|
||||
|
||||
### Setup Script Not Found
|
||||
|
||||
{{< callout type="error" >}}
|
||||
**Error:** `./setup.sh: Permission denied`
|
||||
{{< /callout >}}
|
||||
|
||||
Make the script executable:
|
||||
|
||||
```bash
|
||||
chmod +x setup.sh
|
||||
```
|
||||
|
||||
## Manual Setup (Alternative)
|
||||
|
||||
If you prefer manual setup without the script:
|
||||
|
||||
### Locating Hytale Installation
|
||||
|
||||
Find your Hytale installation directory:
|
||||
|
||||
{{< tabs items="Windows,Linux,macOS" >}}
|
||||
{{< tab >}}
|
||||
```
|
||||
%appdata%\Hytale\install\release\package\game\latest
|
||||
```
|
||||
{{< /tab >}}
|
||||
{{< tab >}}
|
||||
```
|
||||
$XDG_DATA_HOME/Hytale/install/release/package/game/latest
|
||||
```
|
||||
Or typically:
|
||||
```
|
||||
~/.local/share/Hytale/install/release/package/game/latest
|
||||
```
|
||||
{{< /tab >}}
|
||||
{{< tab >}}
|
||||
```
|
||||
~/Application Support/Hytale/install/release/package/game/latest
|
||||
```
|
||||
{{< /tab >}}
|
||||
{{< /tabs >}}
|
||||
|
||||
### Manual Server Setup
|
||||
|
||||
1. Copy `Server/` and `Assets.zip` from your Hytale installation
|
||||
2. Download CFR from [https://www.benf.org/other/cfr/](https://www.benf.org/other/cfr/)
|
||||
3. Decompile: `java -jar cfr.jar HytaleServer.jar --outputdir src-ref`
|
||||
|
||||
## Next Steps
|
||||
|
||||
Now that you can build and run your plugin, explore:
|
||||
|
||||
- [Plugin Lifecycle](../plugin-lifecycle) - Understand setup, start, and shutdown
|
||||
- [Commands](../../commands) - Create custom commands
|
||||
- [Events](../../events) - Listen to game events
|
||||
246
content/getting-started/building-and-running.fr.md
Normal file
246
content/getting-started/building-and-running.fr.md
Normal file
@@ -0,0 +1,246 @@
|
||||
---
|
||||
title: Compilation et Exécution
|
||||
type: docs
|
||||
weight: 2
|
||||
---
|
||||
|
||||
Ce guide explique comment configurer votre environnement de développement, compiler votre plugin et le déployer sur un serveur Hytale.
|
||||
|
||||
## Démarrage Rapide avec example-mod
|
||||
|
||||
La façon la plus simple de commencer le développement de plugins est d'utiliser le template [example-mod](https://github.com/hytale-france/example-mod) qui inclut un script de configuration automatisé.
|
||||
|
||||
### 1. Cloner le Dépôt
|
||||
|
||||
```bash
|
||||
git clone https://github.com/hytale-france/example-mod.git
|
||||
cd example-mod
|
||||
```
|
||||
|
||||
Ou téléchargez la dernière release depuis [GitHub Releases](https://github.com/hytale-france/example-mod/releases).
|
||||
|
||||
### 2. Télécharger les Outils (Une fois)
|
||||
|
||||
Téléchargez les outils requis (hytale-downloader et décompilateur CFR) :
|
||||
|
||||
```bash
|
||||
./setup.sh --download
|
||||
```
|
||||
|
||||
Cela crée un répertoire `.bin/` avec :
|
||||
- `hytale-downloader-*` - Téléchargeur officiel du serveur Hytale
|
||||
- `cfr-0.152.jar` - Décompilateur Java pour les sources de référence
|
||||
|
||||
### 3. Télécharger le Serveur
|
||||
|
||||
Téléchargez et extrayez le serveur Hytale :
|
||||
|
||||
```bash
|
||||
./setup.sh --setup
|
||||
```
|
||||
|
||||
Le serveur sera disponible dans `server/Server/HytaleServer.jar`.
|
||||
|
||||
### 4. Générer les Sources de Référence (Optionnel)
|
||||
|
||||
Décompilez le JAR serveur pour obtenir les sources de référence de l'API :
|
||||
|
||||
```bash
|
||||
./setup.sh --decompile
|
||||
```
|
||||
|
||||
Cela crée `src-ref/` avec les sources Java décompilées pour l'autocomplétion IDE et la documentation.
|
||||
|
||||
## Structure du Projet
|
||||
|
||||
Après la configuration, votre projet ressemblera à ceci :
|
||||
|
||||
```
|
||||
example-mod/
|
||||
├── app/
|
||||
│ ├── src/main/java/org/example/
|
||||
│ │ └── ExamplePlugin.java
|
||||
│ ├── src/main/resources/
|
||||
│ │ └── manifest.json
|
||||
│ └── build.gradle.kts
|
||||
├── server/
|
||||
│ ├── Server/
|
||||
│ │ └── HytaleServer.jar
|
||||
│ └── Assets.zip
|
||||
├── src-ref/ # Sources de référence décompilées
|
||||
├── .bin/ # Outils téléchargés
|
||||
├── setup.sh # Script d'automatisation
|
||||
├── build.gradle.kts
|
||||
├── settings.gradle.kts
|
||||
└── gradlew
|
||||
```
|
||||
|
||||
## Compilation du Plugin
|
||||
|
||||
### 1. Compiler avec Gradle
|
||||
|
||||
```bash
|
||||
# Sur Linux/macOS
|
||||
./gradlew build
|
||||
|
||||
# Sur Windows
|
||||
gradlew.bat build
|
||||
```
|
||||
|
||||
### 2. Localiser le JAR Compilé
|
||||
|
||||
Après une compilation réussie, votre JAR de plugin sera dans :
|
||||
|
||||
```
|
||||
app/build/libs/ExamplePlugin-1.0.0.jar
|
||||
```
|
||||
|
||||
## Exécution du Serveur
|
||||
|
||||
### 1. Configuration Initiale du Serveur
|
||||
|
||||
Démarrez le serveur pour la première fois :
|
||||
|
||||
```bash
|
||||
cd server
|
||||
java -jar Server/HytaleServer.jar --assets Assets.zip
|
||||
```
|
||||
|
||||
### 2. S'Authentifier
|
||||
|
||||
Une fois la console du serveur prête, exécutez la commande d'authentification :
|
||||
|
||||
```
|
||||
/auth login device
|
||||
```
|
||||
|
||||
Suivez les instructions pour vous authentifier avec votre compte Hytale.
|
||||
|
||||
{{< callout type="warning" >}}
|
||||
**Authentification Requise :** Si aucun token serveur n'est configuré, vous verrez un avertissement au démarrage :
|
||||
```
|
||||
No server tokens configured. Use /auth login to authenticate.
|
||||
```
|
||||
Vous devez vous authentifier avant que les joueurs puissent rejoindre le serveur en mode non-singleplayer.
|
||||
{{< /callout >}}
|
||||
|
||||
### 3. Arrêter le Serveur
|
||||
|
||||
Après l'authentification, vous pouvez arrêter le serveur :
|
||||
|
||||
- **Linux/macOS:** Appuyez sur `Ctrl+C`
|
||||
- **Windows:** Appuyez sur `Ctrl+C` ou fermez le terminal
|
||||
|
||||
## Déploiement du Plugin
|
||||
|
||||
### 1. Copier le JAR
|
||||
|
||||
Copiez le JAR compilé dans le dossier `mods` :
|
||||
|
||||
```bash
|
||||
cp app/build/libs/ExamplePlugin-1.0.0.jar server/mods/
|
||||
```
|
||||
|
||||
### 2. Démarrer le Serveur
|
||||
|
||||
```bash
|
||||
cd server
|
||||
java -jar Server/HytaleServer.jar --assets Assets.zip
|
||||
```
|
||||
|
||||
### 3. Vérifier le Chargement
|
||||
|
||||
Vous devriez voir votre plugin se charger dans la console :
|
||||
|
||||
```
|
||||
[INFO] [PluginManager] Loading pending plugins from directory: mods
|
||||
[INFO] [PluginManager] - org.example:ExamplePlugin from path ExamplePlugin-1.0.0.jar
|
||||
```
|
||||
|
||||
## Mise à Jour du Serveur
|
||||
|
||||
Lorsqu'une nouvelle version d'Hytale est publiée :
|
||||
|
||||
```bash
|
||||
./setup.sh --update
|
||||
```
|
||||
|
||||
Cela téléchargera la dernière version du serveur et mettra à jour votre installation.
|
||||
|
||||
## Problèmes Courants
|
||||
|
||||
### Version Java Incompatible
|
||||
|
||||
{{< callout type="error" >}}
|
||||
**Erreur :** `Unsupported class file major version 69`
|
||||
{{< /callout >}}
|
||||
|
||||
Assurez-vous d'utiliser Java 25 :
|
||||
|
||||
```bash
|
||||
java --version
|
||||
```
|
||||
|
||||
### Manifest Non Trouvé
|
||||
|
||||
{{< callout type="error" >}}
|
||||
**Erreur :** `Failed to load manifest file!`
|
||||
{{< /callout >}}
|
||||
|
||||
Assurez-vous que `manifest.json` est dans `src/main/resources/` et inclus dans le JAR.
|
||||
|
||||
### Script de Configuration Non Trouvé
|
||||
|
||||
{{< callout type="error" >}}
|
||||
**Erreur :** `./setup.sh: Permission denied`
|
||||
{{< /callout >}}
|
||||
|
||||
Rendez le script exécutable :
|
||||
|
||||
```bash
|
||||
chmod +x setup.sh
|
||||
```
|
||||
|
||||
## Configuration Manuelle (Alternative)
|
||||
|
||||
Si vous préférez une configuration manuelle sans le script :
|
||||
|
||||
### Localiser l'Installation Hytale
|
||||
|
||||
Trouvez votre répertoire d'installation Hytale :
|
||||
|
||||
{{< tabs items="Windows,Linux,macOS" >}}
|
||||
{{< tab >}}
|
||||
```
|
||||
%appdata%\Hytale\install\release\package\game\latest
|
||||
```
|
||||
{{< /tab >}}
|
||||
{{< tab >}}
|
||||
```
|
||||
$XDG_DATA_HOME/Hytale/install/release/package/game/latest
|
||||
```
|
||||
Ou généralement :
|
||||
```
|
||||
~/.local/share/Hytale/install/release/package/game/latest
|
||||
```
|
||||
{{< /tab >}}
|
||||
{{< tab >}}
|
||||
```
|
||||
~/Application Support/Hytale/install/release/package/game/latest
|
||||
```
|
||||
{{< /tab >}}
|
||||
{{< /tabs >}}
|
||||
|
||||
### Configuration Manuelle du Serveur
|
||||
|
||||
1. Copiez `Server/` et `Assets.zip` depuis votre installation Hytale
|
||||
2. Téléchargez CFR depuis [https://www.benf.org/other/cfr/](https://www.benf.org/other/cfr/)
|
||||
3. Décompilez : `java -jar cfr.jar HytaleServer.jar --outputdir src-ref`
|
||||
|
||||
## Étapes Suivantes
|
||||
|
||||
Maintenant que vous pouvez compiler et exécuter votre plugin, explorez :
|
||||
|
||||
- [Cycle de Vie du Plugin](../plugin-lifecycle) - Comprendre setup, start et shutdown
|
||||
- [Commandes](../../commands) - Créer des commandes personnalisées
|
||||
- [Événements](../../events) - Écouter les événements du jeu
|
||||
196
content/getting-started/creating-a-plugin.en.md
Normal file
196
content/getting-started/creating-a-plugin.en.md
Normal file
@@ -0,0 +1,196 @@
|
||||
---
|
||||
title: Creating a Plugin
|
||||
type: docs
|
||||
weight: 3
|
||||
---
|
||||
|
||||
This guide walks you through creating your first Hytale plugin from scratch.
|
||||
|
||||
## Project Structure
|
||||
|
||||
A typical Hytale plugin project has this structure:
|
||||
|
||||
```
|
||||
my-plugin/
|
||||
├── app/
|
||||
│ ├── build.gradle.kts
|
||||
│ └── src/
|
||||
│ ├── main/
|
||||
│ │ ├── java/
|
||||
│ │ │ └── com/example/myplugin/
|
||||
│ │ │ └── MyPlugin.java
|
||||
│ │ └── resources/
|
||||
│ │ └── manifest.json
|
||||
│ └── test/
|
||||
│ └── java/
|
||||
├── gradle/
|
||||
│ ├── libs.versions.toml
|
||||
│ └── wrapper/
|
||||
├── build.gradle.kts
|
||||
├── settings.gradle.kts
|
||||
└── gradlew
|
||||
```
|
||||
|
||||
## The manifest.json
|
||||
|
||||
Every plugin requires a `manifest.json` file in `src/main/resources/`:
|
||||
|
||||
```json
|
||||
{
|
||||
"Group": "com.example",
|
||||
"Name": "MyPlugin",
|
||||
"Version": "1.0.0",
|
||||
"Description": "My first Hytale plugin",
|
||||
"Authors": [
|
||||
{
|
||||
"Name": "Your Name"
|
||||
}
|
||||
],
|
||||
"Main": "com.example.myplugin.MyPlugin",
|
||||
"ServerVersion": "*",
|
||||
"Dependencies": {},
|
||||
"OptionalDependencies": {},
|
||||
"DisabledByDefault": false,
|
||||
"IncludesAssetPack": false,
|
||||
"SubPlugins": []
|
||||
}
|
||||
```
|
||||
|
||||
### Manifest Fields
|
||||
|
||||
| Field | Required | Description |
|
||||
|-------|----------|-------------|
|
||||
| `Group` | Yes | Package group (e.g., "com.example") |
|
||||
| `Name` | Yes | Plugin name (used for identification) |
|
||||
| `Version` | Yes | Semantic version (e.g., "1.0.0") |
|
||||
| `Description` | No | Brief description of the plugin |
|
||||
| `Authors` | No | List of authors with `Name` field |
|
||||
| `Main` | Yes | Fully qualified main class name |
|
||||
| `ServerVersion` | Yes | Server version compatibility ("*" for any) |
|
||||
| `Dependencies` | No | Required plugin dependencies |
|
||||
| `OptionalDependencies` | No | Optional plugin dependencies |
|
||||
| `DisabledByDefault` | No | Whether plugin is disabled by default |
|
||||
| `IncludesAssetPack` | No | Whether plugin includes assets |
|
||||
| `SubPlugins` | No | List of sub-plugins |
|
||||
|
||||
{{< callout type="warning" >}}
|
||||
All manifest field names use **PascalCase** (e.g., `ServerVersion`, not `serverVersion`).
|
||||
{{< /callout >}}
|
||||
|
||||
## Main Plugin Class
|
||||
|
||||
Create your main plugin class extending `JavaPlugin`:
|
||||
|
||||
```java
|
||||
package com.example.myplugin;
|
||||
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPlugin;
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class MyPlugin extends JavaPlugin {
|
||||
|
||||
public MyPlugin(JavaPluginInit init) {
|
||||
super(init);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
// Called during plugin initialization
|
||||
// Register configs, prepare resources
|
||||
getLogger().at(Level.INFO).log("MyPlugin is setting up!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
// Called when the plugin starts
|
||||
// Register commands, events, entities
|
||||
getLogger().at(Level.INFO).log("MyPlugin has started!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
// Called when the plugin is stopping
|
||||
// Clean up resources
|
||||
getLogger().at(Level.INFO).log("MyPlugin is shutting down!");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
The constructor with `JavaPluginInit` parameter is required. Always call `super(init)`.
|
||||
{{< /callout >}}
|
||||
|
||||
## Logger API
|
||||
|
||||
Hytale uses a Flogger-based logging API:
|
||||
|
||||
```java
|
||||
import java.util.logging.Level;
|
||||
|
||||
// Basic logging
|
||||
getLogger().at(Level.INFO).log("Information message");
|
||||
getLogger().at(Level.WARNING).log("Warning message");
|
||||
getLogger().at(Level.SEVERE).log("Error message");
|
||||
|
||||
// With formatting
|
||||
getLogger().at(Level.INFO).log("Player %s joined the game", playerName);
|
||||
```
|
||||
|
||||
## build.gradle.kts
|
||||
|
||||
Configure your Gradle build file (Kotlin DSL):
|
||||
|
||||
```kotlin
|
||||
plugins {
|
||||
java
|
||||
}
|
||||
|
||||
group = "com.example"
|
||||
version = "1.0.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(25)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Hytale Server API - compile only since it's provided at runtime
|
||||
compileOnly(files("../../../HytaleServer.jar"))
|
||||
|
||||
// Testing
|
||||
testImplementation(libs.junit)
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
archiveBaseName.set("MyPlugin")
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
The path to `HytaleServer.jar` depends on where your plugin source is located relative to the game directory.
|
||||
{{< /callout >}}
|
||||
|
||||
## Available Registries
|
||||
|
||||
Your plugin has access to several registries through the base class:
|
||||
|
||||
| Method | Registry Type | Purpose |
|
||||
|--------|--------------|---------|
|
||||
| `getEventRegistry()` | EventRegistry | Register event listeners |
|
||||
| `getCommandRegistry()` | CommandRegistry | Register commands |
|
||||
| `getEntityRegistry()` | EntityRegistry | Register custom entities |
|
||||
| `getBlockStateRegistry()` | BlockStateRegistry | Register block states |
|
||||
| `getTaskRegistry()` | TaskRegistry | Schedule tasks |
|
||||
| `getAssetRegistry()` | AssetRegistry | Register assets |
|
||||
| `getEntityStoreRegistry()` | EntityStoreRegistry | Register entity components |
|
||||
| `getChunkStoreRegistry()` | ChunkStoreRegistry | Register chunk components |
|
||||
|
||||
## Next Steps
|
||||
|
||||
Learn about the [Plugin Lifecycle](../plugin-lifecycle) to understand when each method is called.
|
||||
196
content/getting-started/creating-a-plugin.fr.md
Normal file
196
content/getting-started/creating-a-plugin.fr.md
Normal file
@@ -0,0 +1,196 @@
|
||||
---
|
||||
title: Créer un Plugin
|
||||
type: docs
|
||||
weight: 3
|
||||
---
|
||||
|
||||
Ce guide vous accompagne dans la création de votre premier plugin Hytale.
|
||||
|
||||
## Structure du Projet
|
||||
|
||||
Un projet de plugin Hytale typique a cette structure :
|
||||
|
||||
```
|
||||
my-plugin/
|
||||
├── app/
|
||||
│ ├── build.gradle.kts
|
||||
│ └── src/
|
||||
│ ├── main/
|
||||
│ │ ├── java/
|
||||
│ │ │ └── com/example/myplugin/
|
||||
│ │ │ └── MyPlugin.java
|
||||
│ │ └── resources/
|
||||
│ │ └── manifest.json
|
||||
│ └── test/
|
||||
│ └── java/
|
||||
├── gradle/
|
||||
│ ├── libs.versions.toml
|
||||
│ └── wrapper/
|
||||
├── build.gradle.kts
|
||||
├── settings.gradle.kts
|
||||
└── gradlew
|
||||
```
|
||||
|
||||
## Le manifest.json
|
||||
|
||||
Chaque plugin nécessite un fichier `manifest.json` dans `src/main/resources/` :
|
||||
|
||||
```json
|
||||
{
|
||||
"Group": "com.example",
|
||||
"Name": "MyPlugin",
|
||||
"Version": "1.0.0",
|
||||
"Description": "Mon premier plugin Hytale",
|
||||
"Authors": [
|
||||
{
|
||||
"Name": "Votre Nom"
|
||||
}
|
||||
],
|
||||
"Main": "com.example.myplugin.MyPlugin",
|
||||
"ServerVersion": "*",
|
||||
"Dependencies": {},
|
||||
"OptionalDependencies": {},
|
||||
"DisabledByDefault": false,
|
||||
"IncludesAssetPack": false,
|
||||
"SubPlugins": []
|
||||
}
|
||||
```
|
||||
|
||||
### Champs du Manifest
|
||||
|
||||
| Champ | Requis | Description |
|
||||
|-------|--------|-------------|
|
||||
| `Group` | Oui | Groupe de package (ex: "com.example") |
|
||||
| `Name` | Oui | Nom du plugin (utilisé pour l'identification) |
|
||||
| `Version` | Oui | Version sémantique (ex: "1.0.0") |
|
||||
| `Description` | Non | Brève description du plugin |
|
||||
| `Authors` | Non | Liste des auteurs avec champ `Name` |
|
||||
| `Main` | Oui | Nom complet de la classe principale |
|
||||
| `ServerVersion` | Oui | Compatibilité version serveur ("*" pour toutes) |
|
||||
| `Dependencies` | Non | Dépendances de plugins requises |
|
||||
| `OptionalDependencies` | Non | Dépendances de plugins optionnelles |
|
||||
| `DisabledByDefault` | Non | Si le plugin est désactivé par défaut |
|
||||
| `IncludesAssetPack` | Non | Si le plugin inclut des assets |
|
||||
| `SubPlugins` | Non | Liste des sous-plugins |
|
||||
|
||||
{{< callout type="warning" >}}
|
||||
Tous les noms de champs du manifest utilisent le **PascalCase** (ex: `ServerVersion`, pas `serverVersion`).
|
||||
{{< /callout >}}
|
||||
|
||||
## Classe Principale du Plugin
|
||||
|
||||
Créez votre classe principale en étendant `JavaPlugin` :
|
||||
|
||||
```java
|
||||
package com.example.myplugin;
|
||||
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPlugin;
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class MyPlugin extends JavaPlugin {
|
||||
|
||||
public MyPlugin(JavaPluginInit init) {
|
||||
super(init);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
// Appelé pendant l'initialisation du plugin
|
||||
// Enregistrer les configs, préparer les ressources
|
||||
getLogger().at(Level.INFO).log("MyPlugin s'initialise !");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
// Appelé quand le plugin démarre
|
||||
// Enregistrer les commandes, événements, entités
|
||||
getLogger().at(Level.INFO).log("MyPlugin a démarré !");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
// Appelé quand le plugin s'arrête
|
||||
// Nettoyer les ressources
|
||||
getLogger().at(Level.INFO).log("MyPlugin s'arrête !");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
Le constructeur avec le paramètre `JavaPluginInit` est obligatoire. Appelez toujours `super(init)`.
|
||||
{{< /callout >}}
|
||||
|
||||
## API de Logging
|
||||
|
||||
Hytale utilise une API de logging basée sur Flogger :
|
||||
|
||||
```java
|
||||
import java.util.logging.Level;
|
||||
|
||||
// Logging basique
|
||||
getLogger().at(Level.INFO).log("Message d'information");
|
||||
getLogger().at(Level.WARNING).log("Message d'avertissement");
|
||||
getLogger().at(Level.SEVERE).log("Message d'erreur");
|
||||
|
||||
// Avec formatage
|
||||
getLogger().at(Level.INFO).log("Le joueur %s a rejoint la partie", playerName);
|
||||
```
|
||||
|
||||
## build.gradle.kts
|
||||
|
||||
Configurez votre fichier de build Gradle (DSL Kotlin) :
|
||||
|
||||
```kotlin
|
||||
plugins {
|
||||
java
|
||||
}
|
||||
|
||||
group = "com.example"
|
||||
version = "1.0.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(25)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// API Serveur Hytale - compile only car fournie à l'exécution
|
||||
compileOnly(files("../../../HytaleServer.jar"))
|
||||
|
||||
// Tests
|
||||
testImplementation(libs.junit)
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
archiveBaseName.set("MyPlugin")
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
Le chemin vers `HytaleServer.jar` dépend de l'emplacement de votre source de plugin par rapport au répertoire du jeu.
|
||||
{{< /callout >}}
|
||||
|
||||
## Registres Disponibles
|
||||
|
||||
Votre plugin a accès à plusieurs registres via la classe de base :
|
||||
|
||||
| Méthode | Type de Registre | Utilité |
|
||||
|---------|-----------------|---------|
|
||||
| `getEventRegistry()` | EventRegistry | Enregistrer des écouteurs d'événements |
|
||||
| `getCommandRegistry()` | CommandRegistry | Enregistrer des commandes |
|
||||
| `getEntityRegistry()` | EntityRegistry | Enregistrer des entités personnalisées |
|
||||
| `getBlockStateRegistry()` | BlockStateRegistry | Enregistrer des états de blocs |
|
||||
| `getTaskRegistry()` | TaskRegistry | Planifier des tâches |
|
||||
| `getAssetRegistry()` | AssetRegistry | Enregistrer des assets |
|
||||
| `getEntityStoreRegistry()` | EntityStoreRegistry | Enregistrer des composants d'entité |
|
||||
| `getChunkStoreRegistry()` | ChunkStoreRegistry | Enregistrer des composants de chunk |
|
||||
|
||||
## Étapes Suivantes
|
||||
|
||||
Découvrez le [Cycle de Vie du Plugin](../plugin-lifecycle) pour comprendre quand chaque méthode est appelée.
|
||||
186
content/getting-started/plugin-lifecycle.en.md
Normal file
186
content/getting-started/plugin-lifecycle.en.md
Normal file
@@ -0,0 +1,186 @@
|
||||
---
|
||||
title: Plugin Lifecycle
|
||||
type: docs
|
||||
weight: 4
|
||||
---
|
||||
|
||||
Understanding the plugin lifecycle is essential for properly initializing and cleaning up your plugin resources.
|
||||
|
||||
## Lifecycle States
|
||||
|
||||
A plugin goes through several states during its lifetime:
|
||||
|
||||
```
|
||||
NONE → SETUP → START → ENABLED → SHUTDOWN → DISABLED
|
||||
```
|
||||
|
||||
| State | Description |
|
||||
|-------|-------------|
|
||||
| `NONE` | Initial state before any initialization |
|
||||
| `SETUP` | Plugin is in the setup phase |
|
||||
| `START` | Plugin is starting |
|
||||
| `ENABLED` | Plugin is fully operational |
|
||||
| `SHUTDOWN` | Plugin is shutting down |
|
||||
| `DISABLED` | Plugin has been disabled |
|
||||
|
||||
## Lifecycle Methods
|
||||
|
||||
### Constructor
|
||||
|
||||
The constructor is called when the plugin is instantiated. Use this for:
|
||||
|
||||
- Registering configuration files with `withConfig()` (recommended)
|
||||
- Storing the init reference if needed
|
||||
|
||||
```java
|
||||
import com.hypixel.hytale.server.core.util.Config;
|
||||
|
||||
private Config<MyConfig> config;
|
||||
|
||||
public MyPlugin(JavaPluginInit init) {
|
||||
super(init);
|
||||
// Register config in constructor - loaded asynchronously during preLoad()
|
||||
config = withConfig(MyConfig.CODEC);
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
Registering configs in the constructor ensures they are loaded asynchronously during `preLoad()`, before `setup()` is called. This is the recommended approach.
|
||||
{{< /callout >}}
|
||||
|
||||
### setup()
|
||||
|
||||
Called during the initial setup phase, after configs are loaded. Use this for:
|
||||
|
||||
- Preparing resources that don't depend on other plugins
|
||||
- Early initialization logic
|
||||
- Accessing loaded configuration values
|
||||
|
||||
```java
|
||||
import java.util.logging.Level;
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
// Config is already loaded and available
|
||||
getLogger().at(Level.INFO).log("Setup complete!");
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
To create configuration classes with `CODEC`, see the [Codecs documentation]({{< ref "core-concepts/codecs#buildercodec" >}}).
|
||||
{{< /callout >}}
|
||||
|
||||
{{< callout type="warning" >}}
|
||||
Do not register commands or events in `setup()`. Other plugins may not be loaded yet.
|
||||
{{< /callout >}}
|
||||
|
||||
### start()
|
||||
|
||||
Called after all plugins have completed setup. Use this for:
|
||||
|
||||
- Registering commands
|
||||
- Registering event listeners
|
||||
- Registering entities
|
||||
- Interacting with other plugins
|
||||
|
||||
```java
|
||||
import com.hypixel.hytale.server.core.event.events.player.PlayerConnectEvent;
|
||||
import com.hypixel.hytale.server.core.universe.PlayerRef;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
// Register commands
|
||||
getCommandRegistry().registerCommand(new MyCommand());
|
||||
|
||||
// Register events
|
||||
getEventRegistry().register(PlayerConnectEvent.class, this::onPlayerConnect);
|
||||
|
||||
getLogger().at(Level.INFO).log("Plugin started!");
|
||||
}
|
||||
|
||||
private void onPlayerConnect(PlayerConnectEvent event) {
|
||||
// See PlayerRef documentation for thread-safe player references
|
||||
PlayerRef playerRef = event.getPlayerRef();
|
||||
getLogger().at(Level.INFO).log("Player connecting: " + playerRef.getUsername());
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
See the [Registries documentation]({{< ref "core-concepts/registries" >}}) for a complete list of available registries and their usage.
|
||||
{{< /callout >}}
|
||||
|
||||
### shutdown()
|
||||
|
||||
Called when the plugin is being disabled or the server is stopping. Use this for:
|
||||
|
||||
- Saving data
|
||||
- Cleaning up resources
|
||||
- Canceling scheduled tasks
|
||||
|
||||
```java
|
||||
import java.util.logging.Level;
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
// Save any pending data
|
||||
savePlayerData();
|
||||
|
||||
getLogger().at(Level.INFO).log("Plugin shutdown complete!");
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
Registries are automatically cleaned up after `shutdown()`. You don't need to manually unregister commands or events.
|
||||
{{< /callout >}}
|
||||
|
||||
## Lifecycle Flow Diagram
|
||||
|
||||
{{< steps >}}
|
||||
|
||||
### Plugin Loading
|
||||
The server discovers your plugin JAR and reads `manifest.json`
|
||||
|
||||
### Constructor Called
|
||||
`MyPlugin(JavaPluginInit init)` is instantiated
|
||||
|
||||
### preLoad()
|
||||
Configuration files registered with `withConfig()` are loaded asynchronously
|
||||
|
||||
### setup()
|
||||
Your `setup()` method is called
|
||||
|
||||
### start()
|
||||
Your `start()` method is called after all plugins are set up
|
||||
|
||||
### Running
|
||||
Plugin is now in `ENABLED` state and fully operational
|
||||
|
||||
### shutdown()
|
||||
Called when server stops or plugin is disabled
|
||||
|
||||
### Cleanup
|
||||
All registries are automatically cleaned up
|
||||
|
||||
{{< /steps >}}
|
||||
|
||||
## Checking Plugin State
|
||||
|
||||
You can check if your plugin is enabled:
|
||||
|
||||
```java
|
||||
if (isEnabled()) {
|
||||
// Plugin is running
|
||||
}
|
||||
|
||||
if (isDisabled()) {
|
||||
// Plugin is not running
|
||||
}
|
||||
|
||||
// Get current state
|
||||
PluginState state = getState();
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Learn how to [Build and Run](../building-and-running) your plugin.
|
||||
186
content/getting-started/plugin-lifecycle.fr.md
Normal file
186
content/getting-started/plugin-lifecycle.fr.md
Normal file
@@ -0,0 +1,186 @@
|
||||
---
|
||||
title: Cycle de Vie du Plugin
|
||||
type: docs
|
||||
weight: 4
|
||||
---
|
||||
|
||||
Comprendre le cycle de vie du plugin est essentiel pour initialiser et nettoyer correctement les ressources de votre plugin.
|
||||
|
||||
## États du Cycle de Vie
|
||||
|
||||
Un plugin passe par plusieurs états durant sa vie :
|
||||
|
||||
```
|
||||
NONE → SETUP → START → ENABLED → SHUTDOWN → DISABLED
|
||||
```
|
||||
|
||||
| État | Description |
|
||||
|------|-------------|
|
||||
| `NONE` | État initial avant toute initialisation |
|
||||
| `SETUP` | Le plugin est en phase de configuration |
|
||||
| `START` | Le plugin démarre |
|
||||
| `ENABLED` | Le plugin est pleinement opérationnel |
|
||||
| `SHUTDOWN` | Le plugin s'arrête |
|
||||
| `DISABLED` | Le plugin a été désactivé |
|
||||
|
||||
## Méthodes du Cycle de Vie
|
||||
|
||||
### Constructeur
|
||||
|
||||
Le constructeur est appelé lorsque le plugin est instancié. Utilisez ceci pour :
|
||||
|
||||
- Enregistrer les fichiers de configuration avec `withConfig()` (recommandé)
|
||||
- Stocker la référence init si nécessaire
|
||||
|
||||
```java
|
||||
import com.hypixel.hytale.server.core.util.Config;
|
||||
|
||||
private Config<MyConfig> config;
|
||||
|
||||
public MyPlugin(JavaPluginInit init) {
|
||||
super(init);
|
||||
// Enregistrer la config dans le constructeur - chargée de façon asynchrone pendant preLoad()
|
||||
config = withConfig(MyConfig.CODEC);
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
Enregistrer les configs dans le constructeur garantit qu'elles sont chargées de façon asynchrone pendant `preLoad()`, avant que `setup()` ne soit appelé. C'est l'approche recommandée.
|
||||
{{< /callout >}}
|
||||
|
||||
### setup()
|
||||
|
||||
Appelé pendant la phase initiale de configuration, après le chargement des configs. Utilisez ceci pour :
|
||||
|
||||
- Préparer les ressources qui ne dépendent pas d'autres plugins
|
||||
- Logique d'initialisation précoce
|
||||
- Accéder aux valeurs de configuration chargées
|
||||
|
||||
```java
|
||||
import java.util.logging.Level;
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
// La config est déjà chargée et disponible
|
||||
getLogger().at(Level.INFO).log("Configuration terminée !");
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
Pour créer des classes de configuration avec `CODEC`, voir la [documentation des Codecs]({{< ref "core-concepts/codecs#buildercodec" >}}).
|
||||
{{< /callout >}}
|
||||
|
||||
{{< callout type="warning" >}}
|
||||
N'enregistrez pas de commandes ou d'événements dans `setup()`. D'autres plugins peuvent ne pas être encore chargés.
|
||||
{{< /callout >}}
|
||||
|
||||
### start()
|
||||
|
||||
Appelé après que tous les plugins aient terminé leur configuration. Utilisez ceci pour :
|
||||
|
||||
- Enregistrer les commandes
|
||||
- Enregistrer les écouteurs d'événements
|
||||
- Enregistrer les entités
|
||||
- Interagir avec d'autres plugins
|
||||
|
||||
```java
|
||||
import com.hypixel.hytale.server.core.event.events.player.PlayerConnectEvent;
|
||||
import com.hypixel.hytale.server.core.universe.PlayerRef;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
// Enregistrer les commandes
|
||||
getCommandRegistry().registerCommand(new MyCommand());
|
||||
|
||||
// Enregistrer les événements
|
||||
getEventRegistry().register(PlayerConnectEvent.class, this::onPlayerConnect);
|
||||
|
||||
getLogger().at(Level.INFO).log("Plugin démarré !");
|
||||
}
|
||||
|
||||
private void onPlayerConnect(PlayerConnectEvent event) {
|
||||
// Voir la documentation PlayerRef pour les références thread-safe aux joueurs
|
||||
PlayerRef playerRef = event.getPlayerRef();
|
||||
getLogger().at(Level.INFO).log("Joueur en connexion : " + playerRef.getUsername());
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
Voir la [documentation des Registres]({{< ref "core-concepts/registries" >}}) pour une liste complète des registres disponibles et leur utilisation.
|
||||
{{< /callout >}}
|
||||
|
||||
### shutdown()
|
||||
|
||||
Appelé quand le plugin est désactivé ou le serveur s'arrête. Utilisez ceci pour :
|
||||
|
||||
- Sauvegarder les données
|
||||
- Nettoyer les ressources
|
||||
- Annuler les tâches planifiées
|
||||
|
||||
```java
|
||||
import java.util.logging.Level;
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
// Sauvegarder les données en attente
|
||||
savePlayerData();
|
||||
|
||||
getLogger().at(Level.INFO).log("Arrêt du plugin terminé !");
|
||||
}
|
||||
```
|
||||
|
||||
{{< callout type="info" >}}
|
||||
Les registres sont automatiquement nettoyés après `shutdown()`. Vous n'avez pas besoin de désinscrire manuellement les commandes ou événements.
|
||||
{{< /callout >}}
|
||||
|
||||
## Diagramme du Flux de Vie
|
||||
|
||||
{{< steps >}}
|
||||
|
||||
### Chargement du Plugin
|
||||
Le serveur découvre votre JAR de plugin et lit `manifest.json`
|
||||
|
||||
### Appel du Constructeur
|
||||
`MyPlugin(JavaPluginInit init)` est instancié
|
||||
|
||||
### preLoad()
|
||||
Les fichiers de configuration enregistrés avec `withConfig()` sont chargés de façon asynchrone
|
||||
|
||||
### setup()
|
||||
Votre méthode `setup()` est appelée
|
||||
|
||||
### start()
|
||||
Votre méthode `start()` est appelée après que tous les plugins soient configurés
|
||||
|
||||
### En Cours d'Exécution
|
||||
Le plugin est maintenant en état `ENABLED` et pleinement opérationnel
|
||||
|
||||
### shutdown()
|
||||
Appelé quand le serveur s'arrête ou le plugin est désactivé
|
||||
|
||||
### Nettoyage
|
||||
Tous les registres sont automatiquement nettoyés
|
||||
|
||||
{{< /steps >}}
|
||||
|
||||
## Vérifier l'État du Plugin
|
||||
|
||||
Vous pouvez vérifier si votre plugin est activé :
|
||||
|
||||
```java
|
||||
if (isEnabled()) {
|
||||
// Le plugin fonctionne
|
||||
}
|
||||
|
||||
if (isDisabled()) {
|
||||
// Le plugin ne fonctionne pas
|
||||
}
|
||||
|
||||
// Obtenir l'état actuel
|
||||
PluginState state = getState();
|
||||
```
|
||||
|
||||
## Étapes Suivantes
|
||||
|
||||
Apprenez à [Compiler et Exécuter](../building-and-running) votre plugin.
|
||||
72
content/getting-started/prerequisites.en.md
Normal file
72
content/getting-started/prerequisites.en.md
Normal file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
title: Prerequisites
|
||||
type: docs
|
||||
weight: 1
|
||||
---
|
||||
|
||||
Before you start developing Hytale plugins, you need to set up your development environment.
|
||||
|
||||
## Java 25
|
||||
|
||||
Hytale plugins require **Java 25** or later. Download and install the JDK from:
|
||||
|
||||
- [Eclipse Temurin](https://adoptium.net/) (Recommended)
|
||||
- [Oracle JDK](https://www.oracle.com/java/technologies/downloads/)
|
||||
|
||||
Verify your installation:
|
||||
|
||||
```bash
|
||||
java --version
|
||||
# Should output: openjdk 25.x.x or similar
|
||||
```
|
||||
|
||||
## Gradle
|
||||
|
||||
Hytale plugins use **Gradle** as the build system. You can either:
|
||||
|
||||
1. Use the Gradle Wrapper (recommended) - included in the project template
|
||||
2. Install Gradle globally from [gradle.org](https://gradle.org/install/)
|
||||
|
||||
## IDE (Optional)
|
||||
|
||||
We recommend using one of these IDEs:
|
||||
|
||||
{{< tabs items="IntelliJ IDEA,Eclipse,VS Code" >}}
|
||||
{{< tab >}}
|
||||
**IntelliJ IDEA** (Recommended)
|
||||
|
||||
1. Download [IntelliJ IDEA](https://www.jetbrains.com/idea/) (Community or Ultimate)
|
||||
2. Open your plugin project folder
|
||||
3. IntelliJ will automatically detect the Gradle project
|
||||
4. Wait for the project to sync
|
||||
|
||||
{{< /tab >}}
|
||||
{{< tab >}}
|
||||
**Eclipse**
|
||||
|
||||
1. Download [Eclipse IDE for Java Developers](https://www.eclipse.org/downloads/)
|
||||
2. Install the Buildship Gradle Integration plugin
|
||||
3. Import as a Gradle project
|
||||
|
||||
{{< /tab >}}
|
||||
{{< tab >}}
|
||||
**VS Code**
|
||||
|
||||
1. Install [VS Code](https://code.visualstudio.com/)
|
||||
2. Install the Extension Pack for Java
|
||||
3. Install the Gradle for Java extension
|
||||
4. Open the project folder
|
||||
|
||||
{{< /tab >}}
|
||||
{{< /tabs >}}
|
||||
|
||||
## Hytale Game
|
||||
|
||||
You need the Hytale game installed:
|
||||
|
||||
1. Download and install the [Hytale Launcher](https://hytale.com/)
|
||||
2. Launch the game at least once to download all files
|
||||
|
||||
## Next Steps
|
||||
|
||||
Once your environment is set up, proceed to [Building and Running](../building-and-running) to set up the server and build your first plugin.
|
||||
72
content/getting-started/prerequisites.fr.md
Normal file
72
content/getting-started/prerequisites.fr.md
Normal file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
title: Prérequis
|
||||
type: docs
|
||||
weight: 1
|
||||
---
|
||||
|
||||
Avant de commencer à développer des plugins Hytale, vous devez configurer votre environnement de développement.
|
||||
|
||||
## Java 25
|
||||
|
||||
Les plugins Hytale nécessitent **Java 25** ou supérieur. Téléchargez et installez le JDK depuis :
|
||||
|
||||
- [Eclipse Temurin](https://adoptium.net/) (Recommandé)
|
||||
- [Oracle JDK](https://www.oracle.com/java/technologies/downloads/)
|
||||
|
||||
Vérifiez votre installation :
|
||||
|
||||
```bash
|
||||
java --version
|
||||
# Devrait afficher : openjdk 25.x.x ou similaire
|
||||
```
|
||||
|
||||
## Gradle
|
||||
|
||||
Les plugins Hytale utilisent **Gradle** comme système de build. Vous pouvez soit :
|
||||
|
||||
1. Utiliser le Gradle Wrapper (recommandé) - inclus dans le template de projet
|
||||
2. Installer Gradle globalement depuis [gradle.org](https://gradle.org/install/)
|
||||
|
||||
## IDE (Optionnel)
|
||||
|
||||
Nous recommandons l'utilisation d'un de ces IDEs :
|
||||
|
||||
{{< tabs items="IntelliJ IDEA,Eclipse,VS Code" >}}
|
||||
{{< tab >}}
|
||||
**IntelliJ IDEA** (Recommandé)
|
||||
|
||||
1. Téléchargez [IntelliJ IDEA](https://www.jetbrains.com/idea/) (Community ou Ultimate)
|
||||
2. Ouvrez le dossier de votre projet plugin
|
||||
3. IntelliJ détectera automatiquement le projet Gradle
|
||||
4. Attendez la synchronisation du projet
|
||||
|
||||
{{< /tab >}}
|
||||
{{< tab >}}
|
||||
**Eclipse**
|
||||
|
||||
1. Téléchargez [Eclipse IDE for Java Developers](https://www.eclipse.org/downloads/)
|
||||
2. Installez le plugin Buildship Gradle Integration
|
||||
3. Importez comme projet Gradle
|
||||
|
||||
{{< /tab >}}
|
||||
{{< tab >}}
|
||||
**VS Code**
|
||||
|
||||
1. Installez [VS Code](https://code.visualstudio.com/)
|
||||
2. Installez l'Extension Pack for Java
|
||||
3. Installez l'extension Gradle for Java
|
||||
4. Ouvrez le dossier du projet
|
||||
|
||||
{{< /tab >}}
|
||||
{{< /tabs >}}
|
||||
|
||||
## Jeu Hytale
|
||||
|
||||
Vous avez besoin du jeu Hytale installé :
|
||||
|
||||
1. Téléchargez et installez le [Hytale Launcher](https://hytale.com/)
|
||||
2. Lancez le jeu au moins une fois pour télécharger tous les fichiers
|
||||
|
||||
## Étapes Suivantes
|
||||
|
||||
Une fois votre environnement configuré, passez à [Compilation et Exécution](../building-and-running) pour configurer le serveur et compiler votre premier plugin.
|
||||
Reference in New Issue
Block a user