Class DatapackHelper

java.lang.Object
org.moddingx.libx.datapack.DatapackHelper

public class DatapackHelper extends Object
Adds some utilities for creating custom dynamic datapacks.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Gson
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.server.packs.resources.IoSupplier<InputStream>
    generatePackMeta(net.minecraftforge.forgespi.locating.IModFile file, String description, net.minecraft.server.packs.PackType packType)
    Creates a supplier that can be repeatedly called to create new InputStreams for a dynamically generated pack.mcmeta based on the given mod file.
    static String
    registryPath(net.minecraft.resources.ResourceKey<?> key)
    Gets the path for a registry element inside a datapack.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • GSON

      public static final Gson GSON
  • Constructor Details

    • DatapackHelper

      public DatapackHelper()
  • Method Details

    • registryPath

      public static String registryPath(net.minecraft.resources.ResourceKey<?> key)
      Gets the path for a registry element inside a datapack. For example for the key minecraft:worldgen/biome libx:some_biome, this would be libx/worldgen/biome/some_biome.json
    • generatePackMeta

      public static net.minecraft.server.packs.resources.IoSupplier<InputStream> generatePackMeta(net.minecraftforge.forgespi.locating.IModFile file, String description, net.minecraft.server.packs.PackType packType)
      Creates a supplier that can be repeatedly called to create new InputStreams for a dynamically generated pack.mcmeta based on the given mod file.