fix IModelData being swallowed by renderer
This commit is contained in:
@@ -77,7 +77,7 @@ fun renderWorldBlock(dispatcher: BlockRendererDispatcher,
|
|||||||
): Boolean {
|
): Boolean {
|
||||||
// build context
|
// build context
|
||||||
val blockCtx = CachedBlockCtx(reader, pos)
|
val blockCtx = CachedBlockCtx(reader, pos)
|
||||||
val renderCtx = RenderCtx(dispatcher, buffer, layer, random)
|
val renderCtx = RenderCtx(dispatcher, buffer, layer, random, modelData)
|
||||||
lightingCtx.reset(blockCtx)
|
lightingCtx.reset(blockCtx)
|
||||||
val combinedCtx = CombinedContext(blockCtx, renderCtx, lightingCtx)
|
val combinedCtx = CombinedContext(blockCtx, renderCtx, lightingCtx)
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import net.minecraft.world.IBlockReader
|
|||||||
import net.minecraft.world.IEnviromentBlockReader
|
import net.minecraft.world.IEnviromentBlockReader
|
||||||
import net.minecraft.world.World
|
import net.minecraft.world.World
|
||||||
import net.minecraft.world.biome.Biome
|
import net.minecraft.world.biome.Biome
|
||||||
|
import net.minecraftforge.client.model.data.IModelData
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,8 +65,9 @@ data class RenderCtx(
|
|||||||
val dispatcher: BlockRendererDispatcher,
|
val dispatcher: BlockRendererDispatcher,
|
||||||
val renderBuffer: BufferBuilder,
|
val renderBuffer: BufferBuilder,
|
||||||
val layer: BlockRenderLayer,
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user