Skip to content

AzureDoom/AssetBridge

Repository files navigation

AssetBridge

Runtime helper for embedding and exposing Hytale Asset Editor packs inside plugins.

Version Build License Hytale


Overview

AssetBridge is a lightweight runtime library that lets you bundle asset packs directly inside your plugin jar and have them:

  • Properly ordered during runtime
  • Visible inside the Hytale Asset Editor

Features

  • Asset Editor compatibility out of the box
  • Early asset-pack ordering support
  • Fully configurable runtime behavior
  • Plug-and-play integration

Installation

Gradle (Standard)

repositories {
    mavenCentral()
    maven {
        name = 'AzureDoom Maven'
        url = uri("https://maven.azuredoom.com/mods")
    }
}

dependencies {
    implementation 'com.azuredoom.hytale:hytale-asset-editor-runtime:0.2.0'
}

Shade into your jar

tasks.jar {
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE

    from {
        configurations.runtimeClasspath
            .filter { it.name.endsWith('.jar') }
            .collect { zipTree(it) }
    }
}

Using hytale-tools (Recommended)

plugins {
    id 'java'
    id 'com.azuredoom.hytale-tools' version '1.0.16'
}

When using hytale-tools, AssetBridge is integrated automatically.

You do NOT need to:

  • add the repository
  • declare the dependency
  • configure shading manually

The plugin will:

  • automatically add com.azuredoom.hytale:hytale-asset-editor-runtime:0.2.0
  • make it available on your project's implementation classpath
  • bundle it into your final jar by default
  • This removes the need for manual shading or fat-jar configuration.

Disabling bundling

If you do not want AssetBridge bundled into your jar:

hytaleTools {
    bundleAssetEditorRuntime = false
}

When disabled:

  • the dependency is still available at compile/runtime
  • it will not be included inside your final jar

Overriding the version

You can override the runtime version if needed:

dependencies {
    hytaleBundledRuntime 'com.azuredoom.hytale:hytale-asset-editor-runtime:0.2.0'
}

Declaring the dependency manually replaces the plugin’s default.

When to use manual setup instead

Use the manual dependency plus shading approach if:

  • you are not using hytale-tools
  • you need full control over shading behavior
  • you are integrating into a custom Gradle setup

Otherwise, using hytale-tools is the simplest and recommended approach.


Multiple mods using AssetBridge

It is generally safe for multiple mods to bundle AssetBridge in their own jars.

To avoid conflicts:

  • ensure each mod has a unique plugin identifier / asset pack ID
  • prefer using the same AssetBridge version across mods
  • adjust or disable early asset-pack ordering if multiple mods need custom pack positioning

Usage

Full Example

public final class ExamplePluginIntegration extends JavaPlugin {
    private AssetEditorPackBridge assetEditorBridge;

    @Override
    protected void setup() {
        assetEditorBridge = AssetEditorRuntime.create(
            this,
            AssetEditorRuntimeConfig.builder()
                .enabled(true)
                .enableEarlyAssetPackOrdering(true)
                .verboseLogging(false)
                .build()
        );

        assetEditorBridge.registerEarlyAssetPackOrderingHook();
    }

    @Override
    protected void start() {
        if (assetEditorBridge != null) {
            assetEditorBridge.ensureAssetEditorPackVisible();
        }
    }
}

Minimal Setup

AssetEditorPackBridge bridge = AssetEditorRuntime.create(this);
bridge.registerEarlyAssetPackOrderingHook();

Configuration

AssetEditorRuntimeConfig config = AssetEditorRuntimeConfig.builder()
    .enabled(true)
    .enableEarlyAssetPackOrdering(true)
    .verboseLogging(false)
    .baseAssetPackId("Hytale:Hytale")
    .earlyAssetPackOrderPriority((short) -40)
    .build();

Options

Option Description
enabled Enable/disable runtime
enableEarlyAssetPackOrdering Register early load hook
verboseLogging Enable debug logging
baseAssetPackId Reference pack for ordering
earlyAssetPackOrderPriority Hook priority

How It Works

AssetBridge hooks into Hytale's asset lifecycle to:

  1. Register your embedded asset pack
  2. Replace legacy standalone packs if present
  3. Ensure correct load order
  4. Expose the pack to the Asset Editor when built.

All automatically – no manual intervention required.


🙏 Credits

Inspired by:

About

Lightweight runtime bridge for integrating Asset Editor packs into Hytale plugins.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages