mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 03:44:54 -04:00
fix missing postInit call in WorldRenderer
* Fixes cullfacing and optimizer in <1.13
This commit is contained in:
parent
1490896a85
commit
ddfad202fa
@ -111,7 +111,7 @@ data class BlockState(
|
||||
if (renderers.isEmpty()) {
|
||||
throw IllegalArgumentException("$this has not renderer!")
|
||||
}
|
||||
if (renderers.size == 1 || Minosoft.getConfig().config.game.other.antiMoirePattern) {
|
||||
if (renderers.size == 1 || !Minosoft.getConfig().config.game.other.antiMoirePattern) {
|
||||
return renderers[0]
|
||||
}
|
||||
// ToDo: Support weight attribute
|
||||
|
@ -55,6 +55,8 @@ class WorldRenderer(
|
||||
val visibleChunks: MutableMap<Vec2i, MutableMap<Int, ChunkMeshCollection>> = Collections.synchronizedMap(ConcurrentHashMap())
|
||||
val queuedChunks: MutableSet<Vec2i> = Collections.synchronizedSet(mutableSetOf())
|
||||
|
||||
private var allBlocks: Collection<BlockState>? = null
|
||||
|
||||
var meshes = 0
|
||||
private set
|
||||
var triangles = 0
|
||||
@ -106,7 +108,8 @@ class WorldRenderer(
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
renderWindow.textures.allTextures.addAll(resolveBlockTextureIds(getAllBlocks(connection.version.mapping)))
|
||||
allBlocks = getAllBlocks(connection.version.mapping)
|
||||
renderWindow.textures.allTextures.addAll(resolveBlockTextureIds(allBlocks!!))
|
||||
|
||||
|
||||
// register keybindings
|
||||
@ -129,11 +132,12 @@ class WorldRenderer(
|
||||
renderWindow.textures.use(chunkShader, "textureArray")
|
||||
renderWindow.textures.animator.use(chunkShader, "AnimatedDataBuffer")
|
||||
|
||||
for (block in connection.version.mapping.blockStateIdMap.values) {
|
||||
for (block in allBlocks!!) {
|
||||
for (model in block.renderers) {
|
||||
model.postInit()
|
||||
}
|
||||
}
|
||||
allBlocks = null
|
||||
}
|
||||
|
||||
override fun draw() {
|
||||
|
@ -26,7 +26,6 @@ import glm_.vec3.Vec3i
|
||||
class MultipartRenderer(
|
||||
val models: List<BlockLikeRenderer>,
|
||||
) : BlockLikeRenderer {
|
||||
|
||||
override val faceBorderSizes: Array<Array<FaceSize>?>
|
||||
override val transparentFaces: BooleanArray = BooleanArray(Directions.DIRECTIONS.size)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user