First pass at coloring Sigil of Holding (#787)

This commit is contained in:
Nicholas Ignoffo 2016-06-09 16:59:11 -07:00
parent 513bb113e1
commit 4eda0d6caa
6 changed files with 83 additions and 8 deletions

View file

@ -1,8 +1,12 @@
package WayofTime.bloodmagic.registry;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.IFuelHandler;
import net.minecraftforge.fml.common.registry.GameRegistry;
@ -259,6 +263,23 @@ public class ModItems
{
InventoryRenderHelper renderHelper = BloodMagic.proxy.getRenderHelper();
final ResourceLocation holdingLoc = new ResourceLocation("bloodmagic", "item/ItemSigilHolding");
ModelLoader.setCustomMeshDefinition(
sigilHolding,
new ItemMeshDefinition()
{
@Override
public ModelResourceLocation getModelLocation(ItemStack stack)
{
if (stack.hasTagCompound() && stack.getTagCompound().hasKey(Constants.NBT.COLOR))
return new ModelResourceLocation(holdingLoc, "type=color");
return new ModelResourceLocation(holdingLoc, "type=normal");
}
}
);
ModelLoader.registerItemVariants(sigilHolding, new ModelResourceLocation(holdingLoc, "type=normal"));
ModelLoader.registerItemVariants(sigilHolding, new ModelResourceLocation(holdingLoc, "type=color"));
renderHelper.itemRenderAll(bloodOrb);
OrbRegistry.registerOrbTexture(orbWeak, new ResourceLocation(Constants.Mod.DOMAIN + "ItemBloodOrbWeak"));
OrbRegistry.registerOrbTexture(orbApprentice, new ResourceLocation(Constants.Mod.DOMAIN + "ItemBloodOrbApprentice"));