diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java index f16a7e9a8..e4f72235d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java @@ -19,17 +19,17 @@ public class SpeedControllerRenderer extends SmartTileEntityRenderer(tileEntityIn)); } @Override public void addInstanceData(InstanceContext ctx) { - KineticTileEntityRenderer.renderRotatingBuffer(ctx, getRotatedModel(ctx.te)); + KineticTileEntityRenderer.renderRotatingBuffer(ctx, getRotatedModel(ctx)); } - private InstanceBuffer getRotatedModel(SpeedControllerTileEntity te) { - return CreateClient.kineticRenderer.renderBlockInstanced(KineticTileEntityRenderer.KINETIC_TILE, - KineticTileEntityRenderer.shaft(KineticTileEntityRenderer.getRotationAxisOf(te))); + private InstanceBuffer getRotatedModel(InstanceContext ctx) { + return ctx.getKinetics().renderBlockInstanced(KineticTileEntityRenderer.KINETIC_TILE, + KineticTileEntityRenderer.shaft(KineticTileEntityRenderer.getRotationAxisOf(ctx.te))); } } diff --git a/src/main/java/com/simibubi/create/foundation/utility/render/FastContraptionRenderer.java b/src/main/java/com/simibubi/create/foundation/utility/render/FastContraptionRenderer.java index 465946b71..dcb8a4268 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/render/FastContraptionRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/utility/render/FastContraptionRenderer.java @@ -3,6 +3,8 @@ package com.simibubi.create.foundation.utility.render; import com.mojang.blaze3d.platform.GlStateManager; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionRenderer; +import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerRenderer; +import com.simibubi.create.content.schematics.client.SchematicRenderer; import com.simibubi.create.foundation.utility.render.instancing.IInstanceRendered; import com.simibubi.create.foundation.utility.render.instancing.IInstancedTileEntityRenderer; import com.simibubi.create.foundation.utility.render.shader.Shader; @@ -174,15 +176,6 @@ public class FastContraptionRenderer extends ContraptionRenderer { ShaderCallback callback = ShaderHelper.getViewProjectionCallback(projectionMat, viewMat); - int structureShader = ShaderHelper.useShader(Shader.CONTRAPTION_STRUCTURE, callback); - for (FastContraptionRenderer renderer : renderers.values()) { - renderer.setup(structureShader); - for (ContraptionBuffer layer : renderer.renderLayers) { - layer.render(); - } - renderer.teardown(); - } - int rotatingShader = ShaderHelper.useShader(Shader.CONTRAPTION_ROTATING, callback); for (FastContraptionRenderer renderer : renderers.values()) { renderer.setup(rotatingShader); @@ -197,6 +190,15 @@ public class FastContraptionRenderer extends ContraptionRenderer { renderer.teardown(); } + int structureShader = ShaderHelper.useShader(Shader.CONTRAPTION_STRUCTURE, callback); + for (FastContraptionRenderer renderer : renderers.values()) { + renderer.setup(structureShader); + for (ContraptionBuffer layer : renderer.renderLayers) { + layer.render(); + } + renderer.teardown(); + } + ShaderHelper.releaseShader(); GL11.glDisable(GL13.GL_TEXTURE_3D);