-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent_optifine_guiscale_crash (#123)
* Prevents the chunk loading option from changing while changing the gui scale in the video options, since it can cause crashes * will crash on spongemixins 0.7, forces the chunk loading option to default and changes the tooltip in the options * forces the chunk loading setting to default upon starting the game * remove optifine from targeted mods * I love spotless * spotlessApply (#124) Co-authored-by: Alexdoru <[email protected]> Co-authored-by: GitHub GTNH Actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
60fa234
commit c329c66
Showing
5 changed files
with
54 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/com/mitchej123/hodgepodge/mixins/minecraft/MixinGuiVideoSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.mitchej123.hodgepodge.mixins.minecraft; | ||
|
||
import net.minecraft.client.gui.GuiVideoSettings; | ||
import org.spongepowered.asm.mixin.Dynamic; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(GuiVideoSettings.class) | ||
public class MixinGuiVideoSettings { | ||
|
||
/* | ||
* This mixins is disabled for now as it will crash with Mixins v7.0 | ||
* https://github.com/SpongePowered/Mixin/issues/358 | ||
* TODO enable it once we change to 8.0 | ||
*/ | ||
|
||
@Dynamic("Method is added by optifine's ASM") | ||
@Inject(method = "getTooltipLines", at = @At("HEAD"), remap = false, cancellable = true) | ||
public void hodgepodge$ChangeChunkLoadingTooltip(String btnName, CallbackInfoReturnable<String[]> cir) { | ||
if (btnName.equals("Chunk Loading")) { | ||
cir.setReturnValue(new String[] { | ||
"Chunk Loading is forced to default in GTNH", | ||
" Any other value can cause your game to crash", | ||
" If you want to re-enable this setting you", | ||
" have to open the Hodgepodge config and change", | ||
"\"fixOptifineChunkLoadingCrash\" to false" | ||
}); | ||
cir.cancel(); | ||
} | ||
} | ||
} |