Skip to content

Program132/HL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HytaleLoader

HytaleLoader is a Java library designed to simplify the development of mods for the Hytale server. It provides an abstraction layer inspired by the Bukkit/Spigot API, allowing developers to create mods using annotations for event handling and command registration and much more!

⚠️ Disclaimer

This is an unofficial modding tool for Hytale. Hytale is in alpha and APIs may change.

Features

Core Systems

  • Annotation-based Event Handling: Use @EventHandler to easily register event listeners
  • Annotation-based Command Registration: Use @Command to define commands with metadata
  • SimplePlugin Base Class: Automatic lifecycle management and component registration
  • Configuration System: YAML and JSON config support with automatic loading

Player & World APIs

  • Player API: Comprehensive player management with inventory, permissions, and stats
  • Entity API Base entity class with location, teleportation, and removal
  • World API World wrapper with block manipulation and entity spawning
  • Block API Block class
  • Location API: 3D position and rotation handling
  • Player Stats API: Health, stamina, oxygen, mana management (thread-safe)

Data Storage

  • Redis API: Connection pooling, String/Hash/List/Set operations
  • MySQL API: Connection pooling, prepared statements, transactions, batch operations

Advanced Features

  • Scheduler System: Execute tasks immediately, delayed, or periodically (sync and async)
  • Permission System: Hierarchical permission management with wildcards
  • Command Utilities: Helper methods for command development
  • Item & Inventory System: Easy-to-use API for managing inventories and items
  • Maven Support: Easily integrate into your project

Installation

Building locally

git clone https://github.com/Program132/HL.git
cd HytaleLoader
mvn clean install

Adding dependency

Add the following to your pom.xml:

<dependency>
    <groupId>fr.hytale.loader</groupId>
    <artifactId>HytaleLoader</artifactId>
    <version>1.0.5</version>
    <scope>provided</scope>
</dependency>

Quick Start

Basic Plugin

public class MyMod extends SimplePlugin {

    public MyMod(JavaPluginInit init) {
        super(init);
    }

    @Override
    public void onEnable() {
        getLogger().info("MyMod enabled!");
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        player.sendMessage("Welcome " + player.getName() + "!");
        
        // Get player location
        Location loc = player.getLocation();
        player.sendMessage("You are at: " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ());
    }

    @Command(name = "hello", description = "Says hello")
    public void onHello(CommandContext ctx) {
        ctx.sender().sendMessage(Message.raw("Hello World!"));
    }
}

Documentation

Comprehensive documentation is available in the doc/ directory:

Getting Started

Core APIs

Data Storage

Systems

Reference

Development Workflow

To compile and deploy your mod (Windows):

mvn clean install -f HytaleLoader/pom.xml; mvn clean package -f TestMod/pom.xml; Copy-Item -Force TestMod/target/TestMod-1.0.5.jar server/mods/

Project Structure

HL/
├── HytaleLoader/              # Core library
│   ├── src/main/java/fr/hytale/loader/
│   │   ├── api/               # Public API
│   │   │   ├── Player.java    # Player wrapper
│   │   │   ├── Entity.java    # Entity wrapper
│   │   │   ├── World.java     # World wrapper
│   │   │   ├── Block.java     # Block wrapper
│   │   │   ├── Location.java  # Location wrapper
│   │   │   └── inventory/     # Inventory classes
│   │   ├── datastorage/       # Data storage
│   │   │   ├── RedisClient.java   # Redis client
│   │   │   └── MySQLClient.java   # MySQL client
│   │   ├── command/           # Command system
│   │   ├── event/             # Event system
│   │   ├── config/            # Configuration system
│   │   ├── permission/        # Permission system
│   │   ├── scheduler/         # Task scheduling
│   │   └── plugin/            # Plugin base classes
└── TestMod/                   # Example mod

Contributing

Contributions are welcome! Feel free to:

  • Open issues for bugs or feature requests
  • Submit pull requests
  • Improve documentation
  • Share your plugins made with HytaleLoader

See CHANGELOG.md for detailed version history.

Support

For support, questions, or to showcase your plugins:

  • Open an issue on GitHub
  • Check the documentation in doc/

Made with ❤️ for the Hytale modding community

About

HL is a Hytale library to create mods easily

Resources

Stars

Watchers

Forks

Languages