mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-09 05:46:26 +01:00
aa08ef1430
- Add DiffuseLightCalculator - Add ModelUtil.VANILLA_RENDERER for consistent virtual rendering - Refactor OptifineHandler - Remove MatrixTransformStack
35 lines
1,018 B
Java
35 lines
1,018 B
Java
package com.jozufozu.flywheel.mixin;
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
import org.spongepowered.asm.mixin.injection.At;
|
|
import org.spongepowered.asm.mixin.injection.Inject;
|
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
|
|
import com.jozufozu.flywheel.backend.OptifineHandler;
|
|
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.client.gui.screens.Screen;
|
|
import net.minecraft.client.gui.screens.VideoSettingsScreen;
|
|
|
|
@Mixin(Minecraft.class)
|
|
public class ShaderCloseMixin {
|
|
|
|
@Shadow
|
|
@Nullable
|
|
public Screen screen;
|
|
|
|
@Inject(at = @At("HEAD"), method = "setScreen")
|
|
private void whenScreenChanges(Screen screen, CallbackInfo info) {
|
|
if (OptifineHandler.isOptifineInstalled() && screen instanceof VideoSettingsScreen) {
|
|
Screen old = this.screen;
|
|
if (old != null && old.getClass()
|
|
.getName()
|
|
.startsWith(OptifineHandler.SHADER_PACKAGE)) {
|
|
OptifineHandler.refresh();
|
|
}
|
|
}
|
|
}
|
|
}
|