Compare commits
2 commits
559e36af17
...
1557c984fa
Author | SHA1 | Date | |
---|---|---|---|
1557c984fa | |||
f648afc5dd |
2 changed files with 27 additions and 0 deletions
src/main
|
@ -0,0 +1,26 @@
|
|||
package lat.amy.fixsquared.mixin.nvidia_gl_destroy;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.GL_VENDOR;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
|
||||
@Mixin(Minecraft.class)
|
||||
public abstract class MinecraftMixin {
|
||||
|
||||
@WrapOperation(
|
||||
method = "shutdownMinecraftApplet",
|
||||
at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;destroy()V"))
|
||||
private void shutdownMinecraftApplet$destroy(Operation<Void> operation) {
|
||||
if (GL11.glGetString(GL_VENDOR)
|
||||
.toLowerCase()
|
||||
.contains("nvidia")) return;
|
||||
operation.call();
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
"compatibilityLevel": "JAVA_8",
|
||||
|
||||
"client": [
|
||||
"nvidia_gl_destroy.MinecraftMixin",
|
||||
"double_sound_system.SoundManagerMixin"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue