Fix NPE in tree generation for canSustainPlant()

When BCD compat was added, moved the canSustainPlant() call
up, before the block != null check. This would cause a NPE
during world generation of trees and huge trees, if the block
was null. Added the missing check. Fixes http://pastebin.com/3GFVq1jB