Merge pull request #2008 from HenryLoenwind/fix

Added check for blocks without item
This commit is contained in:
tterrag1098 committed 2015-02-25 06:42:05 -05:00
commit 4a4077a50b
1 file changed
+5 -2
@@ -57,8 +57,11 @@ public final class PainterUtil {
Block sourceId = PainterUtil.getSourceBlock(item);
int meta = PainterUtil.getSourceBlockMetadata(item);
if(sourceId != null) {
ItemStack is = new ItemStack(Item.getItemFromBlock(sourceId), 1, meta);
sourceName = is.getDisplayName();
Item itemFromBlock = Item.getItemFromBlock(sourceId);
if (itemFromBlock != null) {
ItemStack is = new ItemStack(itemFromBlock, 1, meta);
sourceName = is.getDisplayName();
}
}
return Lang.localize("blockPainter.paintedWith") + " " + sourceName;
}