Steve's Series | Asset Manager 5

Merges several assets into one resource pack

  1. TSEngineer
    Native Minecraft Version:
    1.16
    Tested Minecraft Versions:
    • 1.16
    Source Code:
    https://github.com/SteveTheEngineer/SS-AssetManager
    [​IMG]
    > Asset Manager <
    Asset Manager merges several assets into one resource pack. Makes the resourcepacks folder available on the server side, loads resources from the resources.zip of the first world folder and loads assets from other plugins. Also has an additional custom model allocation feature. API Documentation

    Put the resourcepacks you want to be merged and sent to the client into the resourcepacks folder in the server root.

    If you're making a plugin, you can create an assets folder in it's root and put whatever assets you want to be loaded in it. You can also allocate custom model data for your needs (so it won't conflict with other plugins), see below.

    Configuration file:
    Code (YAML):
    #Webserver settings
    webserver
    :
     #Webserver port
      port
    : 25566
      #External url that the web server is available on
      url
    : http://localhost:25566

    #Force resource pack to be downloaded
    force
    : true

    #Pack meta (put icon.png into this folder to set the pack icon)
    pack
    :
     #Pack format
      format
    : 6
      #Pack description, color codes are supported
      description
    : Server resources

    customModelDataAllocations
    : {}
    newCustomModelDataIds
    : {}
    API:

    Code (Java):

    package me.ste.stevesseries.assetmanager;

    public class AssetManager {
        /**
         * @return Resource pack download URL
         */

        public String getResourcePackURL();

        /**
         * @return Resource pack SHA-1 hash
         */

        public byte[] getResourcesHash();

        /**
         * Allocate a custom model data. Persists after restarts/reloads.
         *
         * @param key Allocation ID
         * @param material Custom model item
         * @param modelId Custom model ID
         * @return Custom model data allocation
         */

        public CustomModelDataAllocation allocateCustomModelData(NamespacedKey key, Material material, String modelId);

        /**
         * Recreate the resource pack. Must be called after any changes to the assets.
         */

        public void recreateResourcePack();

        /**
         * @return Asset map, path -> data
         */

        public Map<String, byte[]> getAssetMap();

        /**
         * @return Asset manager instance
         */

        public static AssetManager getInstance();
    }
    public class CustomModelDataAllocation {
        /**
         * @return Custom model allocation namespaced key
         */

        public NamespacedKey getKey();

        /**
         * @return Custom model item
         */

        public Material getItem();

        /**
        * @return Custom model ID
        */

        public String getModel();

        /**
         * @return Allocated custom model data
         */

        public int getData();
    }

Recent Updates

  1. Support java versions beyond java 8