aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/mixin/MixinRenderGlobal_OptiFine.java
blob: dad164c84a5e8d2e30acf01f3b74799ed2066adf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package makamys.neodymium.mixin;

import java.nio.IntBuffer;

import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

import makamys.neodymium.LODMod;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.RenderGlobal;

@Mixin(RenderGlobal.class)
abstract class MixinRenderGlobal_OptiFine {
    
    // for OptiFine's Fast Render option
    @Redirect(method = "renderSortedRenderersFast", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glCallLists(Ljava/nio/IntBuffer;)V"), remap=false)
    private void redirectRenderAllRenderLists(IntBuffer buffer) {
        if(LODMod.shouldRenderVanillaWorld()) {
            GL11.glCallLists(buffer);
        }
    }
    
}