null protection when fetching LeafInfo for leaf block

This commit is contained in:
octarine-noise
2016-12-04 18:26:07 +01:00
parent fdc14595db
commit 70591a484e

View File

@@ -47,10 +47,11 @@ class RenderLeaves : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_ID) {
val isSnowed = ctx.blockState(up1).material.let {
it == Material.SNOW || it == Material.CRAFTED_SNOW
}
renderWorldBlockBase(ctx, dispatcher, renderer, null)
val leafInfo = LeafRegistry[ctx, DOWN]!!
val leafInfo = LeafRegistry[ctx, DOWN] ?: return false
val blockColor = ctx.blockData(Int3.zero).color
renderWorldBlockBase(ctx, dispatcher, renderer, null)
modelRenderer.updateShading(Int3.zero, allFaces)
ShadersModIntegration.leaves(renderer) {
val rand = ctx.semiRandomArray(2)