Class FusionModelProvider

java.lang.Object
com.supermartijn642.fusion.api.provider.FusionModelProvider
All Implemented Interfaces:
net.minecraft.data.DataProvider

public abstract class FusionModelProvider extends Object implements net.minecraft.data.DataProvider
Allows generating model files for Fusion's model types. Users must extend the class and overwrite generate(). Users may use addModel(ResourceLocation, ModelInstance) to add models which should be generated.

Created 01/05/2023 by SuperMartijn642

  • Constructor Details

    • FusionModelProvider

      public FusionModelProvider(String modid, net.minecraft.data.DataGenerator generator)
      Parameters:
      modid - modid of the mod which creates the generator
  • Method Details

    • run

      public final void run(net.minecraft.data.HashCache cache) throws IOException
      Specified by:
      run in interface net.minecraft.data.DataProvider
      Throws:
      IOException
    • generate

      protected abstract void generate()
      Adds models which should be generated through addModel(ResourceLocation, ModelInstance).
    • addModel

      public final void addModel(net.minecraft.resources.ResourceLocation location, ModelInstance<?> model)
      Adds a model to be generated.
      Parameters:
      location - location of the model
      model - model instance to be serialized
    • getName

      public String getName()
      Specified by:
      getName in interface net.minecraft.data.DataProvider