Class FusionTextureMetadataProvider

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

public abstract class FusionTextureMetadataProvider extends Object implements net.minecraft.data.DataProvider
Allows generating texture metadata files for Fusion's texture types. Users must extend the class and overwrite generate(). Users may use addTextureMetadata(ResourceLocation, TextureType, Object) to add metadata which should be generated.

Created 02/05/2023 by SuperMartijn642

  • Constructor Details

    • FusionTextureMetadataProvider

      public FusionTextureMetadataProvider(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 texture metadata which should be generated through addTextureMetadata(ResourceLocation, TextureType, Object).
    • addTextureMetadata

      public final <T> void addTextureMetadata(net.minecraft.resources.ResourceLocation location, TextureType<T> textureType, T data)
      Adds texture metadata to be generated.
      Parameters:
      location - location of the texture
      textureType - type of the texture
      data - metadata to be serialized
    • getName

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