From aaa7f0a26299d89a502f9c6a123532ec90e2939b Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Sun, 10 May 2015 11:18:52 +0200 Subject: [PATCH] Add rendering mappings for materials added through IMC. This means you can add custom textures for them. --- src/main/java/tconstruct/util/IMCHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/tconstruct/util/IMCHandler.java b/src/main/java/tconstruct/util/IMCHandler.java index 1c34b49c..d7812f61 100644 --- a/src/main/java/tconstruct/util/IMCHandler.java +++ b/src/main/java/tconstruct/util/IMCHandler.java @@ -1,6 +1,7 @@ package tconstruct.util; import cofh.api.energy.IEnergyContainerItem; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.event.FMLInterModComms; import net.minecraft.block.Block; @@ -13,6 +14,7 @@ import net.minecraftforge.fluids.FluidStack; import org.apache.logging.log4j.Level; import tconstruct.TConstruct; import tconstruct.library.TConstructRegistry; +import tconstruct.library.client.TConstructClientRegistry; import tconstruct.library.crafting.CastingRecipe; import tconstruct.library.crafting.FluidType; import tconstruct.library.crafting.PatternBuilder; @@ -73,6 +75,10 @@ public final class IMCHandler { TConstructRegistry.addArrowMaterial(id, mass, breakchance); TConstruct.logger.debug("IMC: Added Projectile stats for material " + mat.materialName); } + + // add additional render mapping so resource packs or the mods themselves can have custom textures for the tools + if(FMLCommonHandler.instance().getSide().isClient()) + TConstructClientRegistry.addMaterialRenderMapping(id, "tinker", mat.name().toLowerCase(), true); } } else if(type.equals("addPartBuilderMaterial"))