From efecafdf9a2c0affe8bc008e1d566fd7183b6767 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sun, 4 May 2014 22:34:26 +0300 Subject: [PATCH] Fix rendering of blueprints and templates --- common/buildcraft/builders/ItemBlueprintStandard.java | 7 ++++--- common/buildcraft/builders/ItemBlueprintTemplate.java | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common/buildcraft/builders/ItemBlueprintStandard.java b/common/buildcraft/builders/ItemBlueprintStandard.java index e8d53871..79064b77 100644 --- a/common/buildcraft/builders/ItemBlueprintStandard.java +++ b/common/buildcraft/builders/ItemBlueprintStandard.java @@ -18,7 +18,6 @@ import cpw.mods.fml.relauncher.SideOnly; import buildcraft.core.utils.NBTUtils; public class ItemBlueprintStandard extends ItemBlueprint { - private IIcon cleanBlueprint; private IIcon usedBlueprint; @@ -29,9 +28,11 @@ public class ItemBlueprintStandard extends ItemBlueprint { @Override public IIcon getIconIndex(ItemStack stack) { if (!NBTUtils.getItemData(stack).hasKey("name")) { - return cleanBlueprint; + itemIcon = cleanBlueprint; + return itemIcon; } else { - return usedBlueprint; + itemIcon = usedBlueprint; + return itemIcon; } } diff --git a/common/buildcraft/builders/ItemBlueprintTemplate.java b/common/buildcraft/builders/ItemBlueprintTemplate.java index d5995b7d..3f1f2e53 100644 --- a/common/buildcraft/builders/ItemBlueprintTemplate.java +++ b/common/buildcraft/builders/ItemBlueprintTemplate.java @@ -18,6 +18,7 @@ import cpw.mods.fml.relauncher.SideOnly; import buildcraft.core.utils.NBTUtils; public class ItemBlueprintTemplate extends ItemBlueprint { + private IIcon cleanTemplate; private IIcon usedTemplate; public ItemBlueprintTemplate() { @@ -27,16 +28,18 @@ public class ItemBlueprintTemplate extends ItemBlueprint { @Override public IIcon getIconIndex(ItemStack stack) { if (!NBTUtils.getItemData(stack).hasKey("name")) { + itemIcon = cleanTemplate; return itemIcon; } else { - return usedTemplate; + itemIcon = usedTemplate; + return itemIcon; } } @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = par1IconRegister.registerIcon("buildcraft:template_clean"); + cleanTemplate = par1IconRegister.registerIcon("buildcraft:template_clean"); usedTemplate = par1IconRegister.registerIcon("buildcraft:template_used"); } }