From 33d0f8c3525386ef434eae8ff8e31503c1db0a11 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Mon, 17 Jan 2022 16:27:00 -0800 Subject: [PATCH] Fix crash rendering contraption with batching engine --- gradle.properties | 2 +- .../components/structureMovement/render/FlwContraption.java | 3 +++ .../structureMovement/render/FlwContraptionManager.java | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 81e6315a8..5cfb71bed 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ parchment_version = 2021.12.19 # dependency versions registrate_version = MC1.18-1.0.21 -flywheel_version = 1.18-0.5.1.44 +flywheel_version = 1.18-0.5.1.46 jei_minecraft_version = 1.18 jei_version = 9.0.0.40 diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java index 42518e8f2..49a6ef06b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; import com.jozufozu.flywheel.backend.Backend; +import com.jozufozu.flywheel.backend.gl.GlStateTracker; import com.jozufozu.flywheel.backend.instancing.Engine; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; import com.jozufozu.flywheel.backend.instancing.SerialTaskEngine; @@ -50,11 +51,13 @@ public class FlwContraption extends ContraptionRenderInfo { instanceWorld = new ContraptionInstanceWorld(this); + var restoreState = GlStateTracker.getRestoreState(); buildLayers(); if (Backend.isOn()) { buildInstancedTiles(); buildActors(); } + restoreState.restore(); } public ContraptionLighter getLighter() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java index 5831d17fd..6f9a37c11 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java @@ -58,6 +58,7 @@ public class FlwContraptionManager extends ContraptionRenderingWorld