File tree 3 files changed +37
-1
lines changed
platforms/common/src/main
3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,10 @@ public static boolean shouldShowToasts() {
173
173
return config .showToasts ();
174
174
}
175
175
176
+ public static GraphicsState graphicsState () {
177
+ return config .graphicsState ();
178
+ }
179
+
176
180
public static boolean shouldShowLevels () {
177
181
return isDisabled () || !isLevelCoveredByOverlay ();
178
182
}
Original file line number Diff line number Diff line change
1
+ package dynamic_fps .impl .mixin ;
2
+
3
+ import dynamic_fps .impl .DynamicFPSMod ;
4
+ import dynamic_fps .impl .config .option .GraphicsState ;
5
+ import dynamic_fps .impl .feature .state .OptionHolder ;
6
+ import net .minecraft .client .*;
7
+ import org .spongepowered .asm .mixin .Mixin ;
8
+ import org .spongepowered .asm .mixin .injection .At ;
9
+ import org .spongepowered .asm .mixin .injection .Inject ;
10
+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
11
+
12
+ /**
13
+ * Resets runtime modified graphics settings to the user-specified defaults during saving.
14
+ * Prevents the game from saving the reduced or minimal preset to disk and loading it again.
15
+ */
16
+ @ Mixin (Options .class )
17
+ public abstract class OptionsMixin {
18
+ @ Inject (method = "save" , at = @ At ("HEAD" ))
19
+ private void save0 (CallbackInfo callbackInfo ) {
20
+ if (DynamicFPSMod .graphicsState () != GraphicsState .DEFAULT ) {
21
+ OptionHolder .applyOptions (Minecraft .getInstance ().options , GraphicsState .DEFAULT );
22
+ }
23
+ }
24
+
25
+ @ Inject (method = "save" , at = @ At ("RETURN" ))
26
+ private void save1 (CallbackInfo callbackInfo ) {
27
+ if (DynamicFPSMod .graphicsState () != GraphicsState .DEFAULT ) {
28
+ OptionHolder .applyOptions (Minecraft .getInstance ().options , DynamicFPSMod .graphicsState ());
29
+ }
30
+ }
31
+ }
Original file line number Diff line number Diff line change 9
9
" GuiMixin" ,
10
10
" LoadingOverlayMixin" ,
11
11
" MinecraftMixin" ,
12
+ " OptionsMixin" ,
12
13
" SoundEngineMixin" ,
13
- " ToastManagerMixin" ,
14
+ " ToastManagerMixin" ,
14
15
" bugfix.BlockableEventLoopMixin"
15
16
],
16
17
"mixins" : [],
You can’t perform that action at this time.
0 commit comments