Add try/catch around item.getSubItems in creative tab subset loading

This commit is contained in:
Chicken-Bones committed 2015-04-24 19:05:09 +10:00
1 parent fbcd6692ed
commit e99febf27c
1 file changed
+9 -4
+9 -4
View File
@@ -364,10 +364,15 @@ public class ItemInfo
ItemStackSet set = creativeTabRanges.get(itemTab.getTabIndex());
if (set == null)
creativeTabRanges.set(itemTab.getTabIndex(), set = new ItemStackSet());
stackList.clear();
item.getSubItems(item, itemTab, stackList);
for(ItemStack stack : stackList)
set.add(stack);
try {
stackList.clear();
item.getSubItems(item, itemTab, stackList);
for(ItemStack stack : stackList)
set.add(stack);
} catch (Exception e) {
NEIClientConfig.logger.error("Error loading sub-items for: "+item+". Tab: "+itemTab.getTabLabel(), e);
}
}
}