chunk renderer: ignore block updates if paused

This commit is contained in:
Moritz Zwerger 2023-11-23 18:50:53 +01:00
parent e236585ef1
commit 6e996f80e0
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -27,6 +27,7 @@ import de.bixilon.minosoft.data.world.chunk.update.chunk.NeighbourChangeUpdate
import de.bixilon.minosoft.data.world.chunk.update.chunk.prototype.PrototypeChangeUpdate
import de.bixilon.minosoft.data.world.positions.ChunkPositionUtil.inChunkSectionPosition
import de.bixilon.minosoft.data.world.positions.ChunkPositionUtil.sectionHeight
import de.bixilon.minosoft.gui.rendering.RenderingStates
import de.bixilon.minosoft.gui.rendering.chunk.ChunkRenderer
import de.bixilon.minosoft.gui.rendering.util.VecUtil.inSectionHeight
import de.bixilon.minosoft.modding.event.events.DimensionChangeEvent
@ -139,6 +140,7 @@ object ChunkRendererChangeListener {
private fun ChunkRenderer.handle(update: AbstractWorldUpdate) {
if (context.state == RenderingStates.PAUSED) return
when (update) {
is SingleBlockUpdate -> handle(update)
is SingleBlockDataUpdate -> handle(update)