1
1
package org .polyfrost .colorsaturation .mixin ;
2
2
3
- import cc .polyfrost .oneconfig .internal .gui .impl .BlurHandlerImpl ;
3
+ import com .llamalad7 .mixinextras .injector .wrapoperation .Operation ;
4
+ import com .llamalad7 .mixinextras .injector .wrapoperation .WrapOperation ;
4
5
import org .polyfrost .colorsaturation .EntityRendererHook ;
6
+ import org .polyfrost .oneconfig .api .ui .v1 .internal .BlurHandler ;
5
7
import org .polyfrost .universal .UMinecraft ;
6
8
import org .spongepowered .asm .mixin .Dynamic ;
7
9
import org .spongepowered .asm .mixin .Mixin ;
8
10
import org .spongepowered .asm .mixin .Pseudo ;
9
- import org .spongepowered .asm .mixin .Shadow ;
10
11
import org .spongepowered .asm .mixin .injection .At ;
11
- import org .spongepowered .asm .mixin .injection .Redirect ;
12
12
13
13
@ Pseudo
14
- @ Mixin (targets = "cc.polyfrost.oneconfig.internal.gui.impl.BlurHandlerImpl" , remap = false )
15
- public abstract class BlurHandlerImplMixin {
16
-
17
- @ Shadow abstract boolean isShaderActive ();
14
+ @ Mixin (targets = "org.polyfrost.oneconfig.api.ui.v1.internal.BlurHandler" , remap = false )
15
+ public class BlurHandlerMixin {
18
16
19
17
@ Dynamic ("OneConfig" )
20
- @ Redirect (method = "reloadBlur" , at = @ At (value = "INVOKE" , target = "Lcc/polyfrost/oneconfig/internal/gui/impl/BlurHandlerImpl;isShaderActive()Z" , ordinal = 0 ))
21
- private boolean redirectShaderActive (BlurHandlerImpl a ) { // works without any params in 0.7.11 but in 0.8 things got stricter
18
+ @ WrapOperation (method = "reloadBlur" , at = @ At (value = "INVOKE" , target = "Lcc/polyfrost/oneconfig/internal/gui/impl/BlurHandlerImpl;isShaderActive()Z" , ordinal = 0 ))
19
+ private boolean redirectShaderActive (BlurHandler instance , Object gui , Operation < Boolean > original ) { // works without any params in 0.7.11 but in 0.8 things got stricter
22
20
if (
23
21
//#if MC<=11202
24
22
net .minecraft .client .renderer .OpenGlHelper .shadersSupported
@@ -29,6 +27,7 @@ private boolean redirectShaderActive(BlurHandlerImpl a) { // works without any p
29
27
) {
30
28
return false ;
31
29
}
32
- return isShaderActive ();
30
+
31
+ return original .call (instance , gui );
33
32
}
34
33
}
0 commit comments