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

@@ -10,6 +10,7 @@ import mods.octarinecore.common.times
import net.minecraft.block.Block
import net.minecraft.block.material.Material
import net.minecraft.block.state.IBlockState
import net.minecraft.util.BlockRenderLayer
import net.minecraft.util.EnumFacing
import net.minecraft.util.EnumFacing.*
@@ -53,4 +54,8 @@ fun Model.mix(first: Model, second: Model, predicate: (Int)->Boolean) {
if (predicate(3)) otherQuad.v4.copy() else quad.v4.copy()
).add()
}
}
}
val BlockRenderLayer.isCutout: Boolean get() = (this == BlockRenderLayer.CUTOUT) || (this == BlockRenderLayer.CUTOUT_MIPPED)
fun IBlockState.canRenderInLayer(layer: BlockRenderLayer) = this.block.canRenderInLayer(this, layer)