Class ChiseledTextureProvider

java.lang.Object
com.supermartijn642.rechiseled.api.ChiseledTextureProvider
All Implemented Interfaces:
net.minecraft.data.DataProvider
Direct Known Subclasses:
RechiseledTextureProvider

public abstract class ChiseledTextureProvider extends Object implements net.minecraft.data.DataProvider
Created 24/01/2022 by SuperMartijn642
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected class 
     

    Nested classes/interfaces inherited from interface net.minecraft.data.DataProvider

    net.minecraft.data.DataProvider.Factory<T extends net.minecraft.data.DataProvider>
  • Field Summary

    Fields inherited from interface net.minecraft.data.DataProvider

    FIXED_ORDER_FIELDS, KEY_COMPARATOR, LOGGER
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChiseledTextureProvider(String modid, net.minecraft.data.DataGenerator generator, net.minecraftforge.common.data.ExistingFileHelper existingFileHelper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    createPaletteMap(net.minecraft.resources.ResourceLocation oldPalette, net.minecraft.resources.ResourceLocation newPalette)
    Creates a map from colors in oldPalette to newPalette.
    protected void
    createPlankTextures(net.minecraft.resources.ResourceLocation plankTexture, String outputLocation)
    Maps all oak plank variants in rechiseled to the given plank texture.
    protected abstract void
    A palette map generates a map of colors from one texture to another.
     
    run(net.minecraft.data.CachedOutput cache)
     

    Methods inherited from class java.lang.Object

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

    • ChiseledTextureProvider

      public ChiseledTextureProvider(String modid, net.minecraft.data.DataGenerator generator, net.minecraftforge.common.data.ExistingFileHelper existingFileHelper)
  • Method Details

    • getName

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

      public CompletableFuture<?> run(net.minecraft.data.CachedOutput cache)
      Specified by:
      run in interface net.minecraft.data.DataProvider
    • createTextures

      protected abstract void createTextures()
      A palette map generates a map of colors from one texture to another. The map can then be applied to a variant of the 'from texture' to generate a similar variant of the 'to texture'.
      The 'from' and 'to' texture need to have a similar pattern. For example, a palette map can map variants of oak planks to variants of birch planks.

      A palette map can be obtained using createPaletteMap(ResourceLocation, ResourceLocation) and applied using ChiseledTextureProvider.PaletteMap.applyToTexture(ResourceLocation, String). All mapped textures will be saved and written to file automatically.

      createPlankTextures(ResourceLocation, String) will map all rechiseled's oak plank variants to the given plank texture.

    • createPaletteMap

      protected ChiseledTextureProvider.PaletteMap createPaletteMap(net.minecraft.resources.ResourceLocation oldPalette, net.minecraft.resources.ResourceLocation newPalette)
      Creates a map from colors in oldPalette to newPalette. The palette map can be applied to any texture using the old palette to generate a texture with the new palette.
      Parameters:
      oldPalette - colors to map from
      newPalette - colors to map to
      Throws:
      IllegalArgumentException - when oldPalette or newPalette is null
    • createPlankTextures

      protected void createPlankTextures(net.minecraft.resources.ResourceLocation plankTexture, String outputLocation)
      Maps all oak plank variants in rechiseled to the given plank texture. The textures will be saved with the same suffixes as rechiseled's oak plank textures suffixes.
      For example, the mapped texture of 'assets/rechiseled/textures/oak_planks_bricks.png' will be saved at 'assets/modid/textures/outputLocation_bricks.png'.