mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-27 23:47:09 +01:00
Fix compat with optifine shaders, again
This commit is contained in:
parent
98823e3cf1
commit
b706936be1
1 changed files with 13 additions and 3 deletions
|
@ -9,6 +9,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
import com.jozufozu.flywheel.backend.OptifineHandler;
|
||||
import com.jozufozu.flywheel.event.BeginFrameEvent;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
|
||||
|
@ -35,6 +36,9 @@ public class BeginFrameMixin {
|
|||
@Unique
|
||||
private boolean setup;
|
||||
|
||||
/**
|
||||
* This version gets run by default.
|
||||
*/
|
||||
@Group(name = "setupRender", min = 1)
|
||||
@Inject(method = "renderLevel",
|
||||
at = @At(value = "INVOKE", target = "net.minecraft.client.renderer.WorldRenderer.compileChunksUntil(J)V"),
|
||||
|
@ -44,14 +48,20 @@ public class BeginFrameMixin {
|
|||
CallbackInfo ci, // locals, only care about clippinghelper
|
||||
IProfiler iprofiler, Vector3d vector3d, double d0, double d1, double d2, Matrix4f matrix4f, boolean flag,
|
||||
ClippingHelper clippinghelper) {
|
||||
MinecraftForge.EVENT_BUS.post(new BeginFrameEvent(level, info, clippinghelper));
|
||||
|
||||
setup = true;
|
||||
if (!OptifineHandler.usingShaders()) {
|
||||
MinecraftForge.EVENT_BUS.post(new BeginFrameEvent(level, info, clippinghelper));
|
||||
|
||||
setup = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This version gets run when optifine is installed and shaders are enabled.
|
||||
*/
|
||||
@Group(name = "setupRender")
|
||||
@Inject(at = @At("HEAD"), method = "setupRender")
|
||||
private void setupRenderOptifineCompat(ActiveRenderInfo info, ClippingHelper clippingHelper, boolean p_228437_3_, int frameCount, boolean isSpectator, CallbackInfo ci) {
|
||||
private void setupRender2(ActiveRenderInfo info, ClippingHelper clippingHelper, boolean p_228437_3_, int frameCount, boolean isSpectator, CallbackInfo ci) {
|
||||
if (!setup) {
|
||||
MinecraftForge.EVENT_BUS.post(new BeginFrameEvent(level, info, clippingHelper));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue