Lodestone

Quick rating

Lodestone

No reviews yet

An automatic content loader for Fabric mods.

API/Library
Mod Loaders
Fabric
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Optional
Server Optional

About

Project Details

Type
Mod
License
GNU Lesser General Public License v3.0 or later
Latest Version
1.8.0
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

An automatic content loader for Fabric mods.

Usage

In order to use Lodestone directly, please ensure that you add it as a dependency for your mod. This mod does not add any content by itself.

Lodestone provides basic interfaces and APIs for easily registering modded content during initialization. The most important type provided is the Loaded interface, which the mod is built around. For a basic example, see the Cheese mod.

To create an automatically registered type, simply implement the target environment's associated interface.

/** An item that is loaded at runtime. */
public class LoadedItem extends Item implements CommonLoaded {

    // Required for all instances of `Loaded`. Allows Lodestone to group registered values by mod identifier.
    @Override
    public Identifier getLoaderId() {
        return Identifier.of(YourMod.MOD_ID, "your_item");
    }

    // A function that registers the value at runtime.
    @Override
    public void loadCommon() {
        Registry.register(Registries.ITEM, this.getLoaderId(), this);
    }

}

Each mod environment has its own dedicated interface:

  • CommonLoaded loads the value on the "common" environment, meaning both the client and the server.
  • ClientLoaded only loads the value on the client instance.
  • ServerLoaded only loads the value on the server instance.
  • DataGenerating only loads the value during Fabric's data generation task.

These are intended to be used within each mod initializer to load it properly.

public class YourMod implements ModInitializer {

    public static final String MOD_ID = "your_mod";
    public static final LoadedItem YOUR_ITEM = new LoadedItem(new Settings());

    @Override
    public void onInitialize() {
        // Registers this item for later loading.
        Lodestone.register(CommonLoaded.class, YOUR_ITEM);

        // Which is then done here.
        Lodestone.load(CommonLoaded.class, MOD_ID);
    }

}

Lodestone also provides an abstract class and two annotations for automatic registration of values.

public final class ItemLoader extends AutoLoader {

    @LoadingPriority(-1) // Controls the loading order. In this case, this loads last.
    public static final LoadedItem ITEM_1 = new LoadedItem("item_1", new Settings());
    public static final LoadedItem ITEM_2 = new LoadedItem("item_2", new Settings());
    public static final LoadedItem ITEM_3 = new LoadedItem("item_3", new Settings());
    public static final LoadedItem ITEM_4 = new LoadedItem("item_4", new Settings());
    public static final LoadedItem ITEM_5 = new LoadedItem("item_5", new Settings());

    @IgnoreLoading({ }) // Prevents this value from being loaded.
    public static final LoadedItem NULL = null;

    @Override
    public Identifier getLoaderId() {
        return Identifier.of(YourMod.MOD_ID, "items");
    }

}

This is then registered in a very similar way.

public class YourMod implements ModInitializer {

    public static final String MOD_ID = "your_mod";
    public static final ItemLoader ITEMS = new ItemLoader();

    @Override
    public void onInitialize() {
        // Registers all items for later loading.
        ITEMS.register();

        // Which is then done here.
        Lodestone.load(CommonLoaded.class, MOD_ID);
    }

}

Depending on Lodestone

Lodestone's sole purpose is to be used as a library for other mods. If you would like to depend on Lodestone for your Fabric mod, add the following to your Gradle manifest:

# gradle.properties

lodestone_version = 1.8.0
// build.gradle

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    modImplementation "com.github.Jaxydog:Lodestone:${project.lodestone_version}"

    // Or, to alternatively depend on the most recent commit:
    modImplementation 'com.github.Jaxydog:Lodestone:main-SNAPSHOT'
}

Lodestone should work with many older versions of Minecraft, but only the latest game version is guaranteed to have proper support. I am currently not interested in backporting to versions prior to roughly 1.18, but if you encounter any issues feel free to let me know anyway.

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~12,000
Downloads
Last Updated
CurseForge
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works