Fix fluid rendering bug

- ContraptionRenderDispatcher wasn't cleaning up its state, so fluids were being drawn with the wrong shader program
This commit is contained in:
JozsefA 2021-06-23 00:01:19 -07:00
parent 64c55c1205
commit 312b327161

View File

@ -8,6 +8,7 @@ import static org.lwjgl.opengl.GL13.GL_TEXTURE_3D;
import static org.lwjgl.opengl.GL13.glActiveTexture; import static org.lwjgl.opengl.GL13.glActiveTexture;
import static org.lwjgl.opengl.GL13.glDisable; import static org.lwjgl.opengl.GL13.glDisable;
import static org.lwjgl.opengl.GL13.glEnable; import static org.lwjgl.opengl.GL13.glEnable;
import static org.lwjgl.opengl.GL20.glUseProgram;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
@ -60,6 +61,8 @@ import net.minecraftforge.common.util.Lazy;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import org.lwjgl.opengl.GL20;
@Mod.EventBusSubscriber @Mod.EventBusSubscriber
public class ContraptionRenderDispatcher { public class ContraptionRenderDispatcher {
private static final Lazy<BlockModelRenderer> MODEL_RENDERER = Lazy.of(() -> new BlockModelRenderer(Minecraft.getInstance().getBlockColors())); private static final Lazy<BlockModelRenderer> MODEL_RENDERER = Lazy.of(() -> new BlockModelRenderer(Minecraft.getInstance().getBlockColors()));
@ -130,6 +133,7 @@ public class ContraptionRenderDispatcher {
layer.endDrawing(); layer.endDrawing();
glDisable(GL_TEXTURE_3D); glDisable(GL_TEXTURE_3D);
glActiveTexture(GL_TEXTURE0); glActiveTexture(GL_TEXTURE0);
glUseProgram(0);
} }
@SubscribeEvent @SubscribeEvent