fix IModelData being swallowed by renderer

This commit is contained in:
octarine-noise
2021-04-26 13:39:09 +02:00
parent 8a82f3772f
commit c668713051
2 changed files with 5 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ fun renderWorldBlock(dispatcher: BlockRendererDispatcher,
): Boolean {
// build context
val blockCtx = CachedBlockCtx(reader, pos)
val renderCtx = RenderCtx(dispatcher, buffer, layer, random)
val renderCtx = RenderCtx(dispatcher, buffer, layer, random, modelData)
lightingCtx.reset(blockCtx)
val combinedCtx = CombinedContext(blockCtx, renderCtx, lightingCtx)

View File

@@ -13,6 +13,7 @@ import net.minecraft.world.IBlockReader
import net.minecraft.world.IEnviromentBlockReader
import net.minecraft.world.World
import net.minecraft.world.biome.Biome
import net.minecraftforge.client.model.data.IModelData
import java.util.*
/**
@@ -64,8 +65,9 @@ data class RenderCtx(
val dispatcher: BlockRendererDispatcher,
val renderBuffer: BufferBuilder,
val layer: BlockRenderLayer,
val random: Random
val random: Random,
val modelData: IModelData
) {
fun render(worldBlock: BlockCtx) = dispatcher.renderBlock(worldBlock.state, worldBlock.pos, worldBlock.world, renderBuffer, random, null)
fun render(worldBlock: BlockCtx) = dispatcher.renderBlock(worldBlock.state, worldBlock.pos, worldBlock.world, renderBuffer, random, modelData)
}