Fixed crash in painter.

This commit is contained in:
CrazyPants committed 2014-07-16 11:06:43 +08:00
1 parent 766b26dff3
commit a377948115
1 file changed
+5 -2
@@ -58,8 +58,11 @@ public final class PainterUtil {
tag = new NBTTagCompound();
item.setTagCompound(tag);
}
tag.setString(BlockPainter.KEY_SOURCE_BLOCK_ID, Block.blockRegistry.getNameForObject(source));
tag.setInteger(BlockPainter.KEY_SOURCE_BLOCK_META, meta);
String name = Block.blockRegistry.getNameForObject(source);
if(name != null && !name.trim().isEmpty()) {
tag.setString(BlockPainter.KEY_SOURCE_BLOCK_ID, name);
tag.setInteger(BlockPainter.KEY_SOURCE_BLOCK_META, meta);
}
}
}