Fix rendering of blueprints and templates

This commit is contained in:
Raul Tambre 2014-05-04 22:34:26 +03:00
parent 049f9c41ba
commit efecafdf9a
2 changed files with 9 additions and 5 deletions

View file

@ -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;
}
}

View file

@ -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");
}
}