Mod

Good Asset Fetcher

Quick rating

Good Asset Fetcher

No reviews yet

Beta 1.7.3 library mod to provide assets from any version of Minecraft to other mods.

API/Library
Mod Loaders
Fabric

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 Required
Server Unsupported

About

Project Details

Type
Mod
License
MIT License
Latest Version
b1.7.3-1.1.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

Good Asset Fetcher

Minecraft Beta 1.7.3 Modrinth Downloads Maven Version

Library mod for StationAPI that provides an interface for other mods to fetch resources from official Mojang jars on the fly when starting the game; this allows mods to utilise the game's assets without incurring license violations.

Currently only supports clientside assets (not datapacks).

Screenshot of code registering assets from Minecraft 1.12.2 with the GoodAssetFetcherRegistryEvent, and Minecraft Beta 1.7.3 with Stone Bricks, Hay Bale, Coal Block, and Redstone Block textures from Minecraft 1.12.2 visible.

Requirements

Usage (for developers)

  1. Import pw.tmpim.mygoodmods:good-asset-fetcher from Maven (see the version badge above for the latest version):

    repositories {
      maven("https://repo.lem.sh/releases") {
        name = "Lemmmy Repo"
        content {
          includeGroupAndSubgroups("sh.lem")
          includeGroupAndSubgroups("pw.tmpim")
        }
      }
    }
    
    dependencies {
      modImplementation("pw.tmpim.mygoodmods:good-asset-fetcher:1.0.4")
    }
    
  2. Register a client-only endpoint for your mod in fabric.mod.json if you don't already have one:

      {
        "entrypoints": {
          "stationapi:event_bus_client": "com.example.yourmod.ExampleModClientListener"
        },  
        "depends": {
          "good-asset-fetcher": "1.x"
        }
      }  
    
  3. Listen to the GoodAssetFetcherRegistryEvent and call addResourceFile, addBlock, or addItem:

    public class ExampleEventListener {
        @Entrypoint.Namespace  
        public static Namespace NAMESPACE;
    
        @EventListener  
        public void onRegisterGoodAssets(GoodAssetFetcherRegistryEvent event) {  
            // shorthands for blocks and items:
            event.addBlock(NAMESPACE, "1.12.2", "redstone_block");
            event.addItem(NAMESPACE, "1.12.2", "stick");
    
            // load an asset by full path:
            event.addResourceFile(NAMESPACE, "1.12.2", "assets/minecraft/textures/blocks/stone.png");
        }
    }
    
  4. Use the textures under assets/your-mod/stationapi/textures/block/stone.png:

    {
      "parent": "minecraft:block/cube_all",
      "textures": {
        "all": "your-mod:block/stone"
      }
    }
    

How it works

During the game's init phase, before resource packs are loaded, Good Asset Fetcher loads the version manifest from the Minecraft Launcher to get a listing of all game versions. This listing is then cached indefinitely at .minecraft/mods/good-asset-fetcher/asset-cache/versionManifest-$modVersion.json.

Then, GoodAssetFetcherRegistryEvent is called to fetch the resource definitions for every mod. Mods may request to fetch assets from (almost?) any version of the game.

When resource packs are loaded, the mod injects its own dynamic resource pack at runtime. When this is first loaded during a session, it checks for any missing assets in the mod's cache directory, .minecraft/mods/good-asset-fetcher/asset-cache.

Armed with the knowledge of all the missing assets and their associated game versions, good-asset-fetcher will download each version's manifest and jar in-memory, validate the hash, and extract the required files. This process is done during resource pack load, so it will block the game the first time it happens, and then ideally remain cached permanently in .minecraft/mods/good-asset-fetcher/asset-cache.

Since StationAPI stores assets in a slightly different location to most versions of vanilla, the mod performs the following path conversions to the destination file path automatically:

Source path Cached path
assets/minecraft/textures/blocks assets/${namespace}/stationapi/textures/block
assets/minecraft/textures/items assets/${namespace}/stationapi/textures/item

If your use case is not properly covered, the addResourceFile(Namespace namespace, String gameVersion, String sourcePath, String destPath) overload is available for you to specify your own destination path. Note, however, that it will still go through the same string replacements as above.

License

This mod is licensed under the MIT license.

Screenshots

Gallery

  • Download assets from any game version at runtime!
    Download assets from any game version at runtime! By registering assets in `GoodAssetFetcherRegistryEvent`, you can download assets from future versions of the game without worrying about violating the game's license.

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

<1,000
Downloads
Last Updated
CurseForge
Created
Last synced
When ModDex last fetched and imported data for this project from CurseForge or Modrinth. High-traffic and active projects are checked more often.
Next pipeline sync