Muffle an error when ItemRenderer is called with the wrong itemstack

Occurs with RefinedStorage Patterns when holding shift to show pattern
output, where the output is a GT generic item. The Pattern renderer can
only replace the IBlockModel and not the ItemStack, so the ItemRenderer
gets called with a stack of ItemPattern.

Fixes raoulvdberge/refinedstorage/#914
This commit is contained in:
David Vierra 2017-01-23 21:27:54 -10:00
parent 52c42c2d63
commit bf3954e031

View file

@ -294,11 +294,13 @@ public class ItemRenderer {
public void renderItem(ItemStack item) {
if(item.getItem() instanceof ItemBlock) {
renderItem(item, 0);
} else {
} else if (item.getItem() instanceof GT_Generic_Item) {
GT_Generic_Item generic_item = (GT_Generic_Item) item.getItem();
for(int i = 0; i < generic_item.getRenderPasses(item); i++) {
renderItem(item, i);
}
} else {
return;
}
}