allow custom renderers to draw on multiple layers

fix extra leaves & fast graphics xray bug
This commit is contained in:
octarine-noise
2017-07-05 11:34:07 +02:00
parent a9fba1a18e
commit 38b35c910b
15 changed files with 45 additions and 29 deletions

View File

@@ -24,12 +24,12 @@ class RenderConnectedGrass : AbstractBlockRenderingHandler(BetterFoliageMod.MOD_
override fun render(ctx: BlockContext, dispatcher: BlockRendererDispatcher, renderer: VertexBuffer, layer: BlockRenderLayer): Boolean {
// if the block sides are not visible anyway, render normally
if (forgeDirsHorizontal.all { ctx.blockState(it.offset).isOpaqueCube }) return renderWorldBlockBase(ctx, dispatcher, renderer, null)
if (forgeDirsHorizontal.all { ctx.blockState(it.offset).isOpaqueCube }) return renderWorldBlockBase(ctx, dispatcher, renderer, layer)
if (ctx.isSurroundedBy { it.isOpaqueCube } ) return false
return ctx.withOffset(Int3.zero, up1) {
ctx.withOffset(up1, up2) {
renderWorldBlockBase(ctx, dispatcher, renderer, null)
renderWorldBlockBase(ctx, dispatcher, renderer, layer)
}
}
}