Fix colors for fletchlings on arrows

This commit is contained in:
Bernhard Bonigl committed 2014-10-10 13:06:34 +02:00
1 parent 852cecae7b
commit 2988b75490
2 files changed
+20

No files matched your search

@@ -56,6 +56,7 @@ public class ToolProxyClient extends ToolProxyCommon
//MinecraftForgeClient.registerItemRenderer(TinkerTools.shortbow, new CustomBowRenderer());
ToolCoreRenderer renderer = new ToolCoreRenderer(false);
/*
MinecraftForgeClient.registerItemRenderer(TinkerTools.pickaxe, renderer);
MinecraftForgeClient.registerItemRenderer(TinkerTools.shovel, renderer);
MinecraftForgeClient.registerItemRenderer(TinkerTools.hatchet, renderer);
@@ -73,6 +74,7 @@ public class ToolProxyClient extends ToolProxyCommon
MinecraftForgeClient.registerItemRenderer(TinkerTools.mattock, renderer);
MinecraftForgeClient.registerItemRenderer(TinkerTools.rapier, renderer);
MinecraftForgeClient.registerItemRenderer(TinkerTools.scythe, renderer);
*/
renderer = new ToolCoreRenderer(true);
MinecraftForgeClient.registerItemRenderer(TinkerTools.dagger, renderer); // todo proper renderer
@@ -1,6 +1,10 @@
package tconstruct.weaponry.ammo;
import tconstruct.TConstruct;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.tools.CustomMaterial;
import tconstruct.library.tools.FletchingMaterial;
import tconstruct.library.tools.FletchlingLeafMaterial;
import tconstruct.weaponry.TinkerWeaponry;
import tconstruct.library.weaponry.AmmoItem;
import net.minecraft.creativetab.CreativeTabs;
@@ -116,4 +120,18 @@ public class ArrowAmmo extends AmmoItem {
else
TConstruct.logger.error("Couldn't build vanilla equivalent of Tinker Arrow");
}
@Override
protected int getDefaultColor(int renderPass, int materialID) {
if(renderPass != 2)
return super.getDefaultColor(renderPass, materialID);
CustomMaterial mat = TConstructRegistry.getCustomMaterial(materialID, FletchingMaterial.class);
if(mat == null)
TConstructRegistry.getCustomMaterial(materialID, FletchlingLeafMaterial.class);
if(mat == null)
return 0xffffff;
return mat.color;
}
}