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:
parent
52c42c2d63
commit
bf3954e031
1 changed files with 3 additions and 1 deletions
|
@ -294,11 +294,13 @@ public class ItemRenderer {
|
||||||
public void renderItem(ItemStack item) {
|
public void renderItem(ItemStack item) {
|
||||||
if(item.getItem() instanceof ItemBlock) {
|
if(item.getItem() instanceof ItemBlock) {
|
||||||
renderItem(item, 0);
|
renderItem(item, 0);
|
||||||
} else {
|
} else if (item.getItem() instanceof GT_Generic_Item) {
|
||||||
GT_Generic_Item generic_item = (GT_Generic_Item) item.getItem();
|
GT_Generic_Item generic_item = (GT_Generic_Item) item.getItem();
|
||||||
for(int i = 0; i < generic_item.getRenderPasses(item); i++) {
|
for(int i = 0; i < generic_item.getRenderPasses(item); i++) {
|
||||||
renderItem(item, i);
|
renderItem(item, i);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue