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 ClassesNested 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
ConstructorsConstructorDescriptionChiseledTextureProvider(String modid, net.minecraft.data.DataGenerator generator, net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) -
Method Summary
Modifier and TypeMethodDescriptionprotected ChiseledTextureProvider.PaletteMapcreatePaletteMap(net.minecraft.resources.ResourceLocation oldPalette, net.minecraft.resources.ResourceLocation newPalette) Creates a map from colors inoldPalettetonewPalette.protected voidcreatePlankTextures(net.minecraft.resources.ResourceLocation plankTexture, String outputLocation) Maps all oak plank variants in rechiseled to the given plank texture.protected abstract voidA palette map generates a map of colors from one texture to another.getName()run(net.minecraft.data.CachedOutput cache)
-
Constructor Details
-
ChiseledTextureProvider
public ChiseledTextureProvider(String modid, net.minecraft.data.DataGenerator generator, net.minecraftforge.common.data.ExistingFileHelper existingFileHelper)
-
-
Method Details
-
getName
- Specified by:
getNamein interfacenet.minecraft.data.DataProvider
-
run
- Specified by:
runin interfacenet.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 usingChiseledTextureProvider.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 inoldPalettetonewPalette. 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 fromnewPalette- colors to map to- Throws:
IllegalArgumentException- whenoldPaletteornewPaletteisnull
-
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'.
-