only when the setting is enabled

This commit is contained in:
Leijurv 2019-01-29 13:54:54 -08:00
parent b471d7419e
commit 9028564c10
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -17,6 +17,7 @@
package baritone.launch.mixins; package baritone.launch.mixins;
import baritone.Baritone;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ChunkRenderContainer; import net.minecraft.client.renderer.ChunkRenderContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -37,13 +38,15 @@ public class MixinChunkRenderContainer {
at = @At("HEAD") at = @At("HEAD")
) )
private void preRenderChunk(RenderChunk renderChunkIn, CallbackInfo ci) { private void preRenderChunk(RenderChunk renderChunkIn, CallbackInfo ci) {
if (Minecraft.getMinecraft().world.getChunk(renderChunkIn.getPosition()).isEmpty()) { if (Baritone.settings().renderCachedChunks.get()) {
GlStateManager.enableAlpha(); if (Minecraft.getMinecraft().world.getChunk(renderChunkIn.getPosition()).isEmpty()) {
GlStateManager.enableBlend(); GlStateManager.enableAlpha();
GL14.glBlendColor(0, 0, 0, 0.5F); GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA, GL_ONE, GL_ZERO); GL14.glBlendColor(0, 0, 0, 0.5F);
} else { GlStateManager.tryBlendFuncSeparate(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA, GL_ONE, GL_ZERO);
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO); } else {
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO);
}
} }
} }
} }