forked from Chocohead/OptiFabric
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
50 additions
and
5 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
8 changes: 8 additions & 0 deletions
8
.../java/me/modmuss50/optifabric/compat/borderlessmining/BorderlessMiningNewMixinPlugin.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,8 @@ | ||
package me.modmuss50.optifabric.compat.borderlessmining; | ||
|
||
public class BorderlessMiningNewMixinPlugin extends BorderlessMiningMixinPlugin { | ||
@Override | ||
protected String getCreateSimpleOptionInitDescriptor() { | ||
return "(Ljava/lang/String;Lnet/minecraft/class_7172$class_7277;Lnet/minecraft/class_7172$class_7303;Lnet/minecraft/class_7172$class_7178;Ljava/lang/Object;Ljava/util/function/Consumer;)V"; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...odmuss50/optifabric/compat/borderlessmining/mixin/OptionFullscreenResolutionNewMixin.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,22 @@ | ||
package me.modmuss50.optifabric.compat.borderlessmining.mixin; | ||
|
||
import me.modmuss50.optifabric.compat.borderlessmining.MagicMixinBridge; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.gui.screen.Screen; | ||
import net.minecraft.client.gui.screen.option.VideoOptionsScreen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyArgs; | ||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args; | ||
|
||
@Pseudo | ||
@Mixin(targets = "net.optifine.gui.OptionFullscreenResolution", remap = false) | ||
abstract class OptionFullscreenResolutionNewMixin { | ||
@ModifyArgs(method = "make", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/class_7172;<init>(Ljava/lang/String;Lnet/minecraft/class_7172$class_7307;Lnet/minecraft/class_7172$class_7277;Lnet/minecraft/class_7172$class_7178;Ljava/lang/Object;Ljava/util/function/Consumer;)V", remap = true)) | ||
private static void modifyOption(Args args) { | ||
Screen screen = MinecraftClient.getInstance().currentScreen; | ||
((MagicMixinBridge) (screen instanceof MagicMixinBridge ? screen : new VideoOptionsScreen(screen, MinecraftClient.getInstance().options))).optifabric£modifyFullscreenButton(args); | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
src/main/resources/optifabric.compat.borderlessmining.new-mixins.json
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,9 @@ | ||
{ | ||
"parent": "optifabric.mixins.json", | ||
"package": "me.modmuss50.optifabric.compat.borderlessmining.mixin", | ||
"plugin": "me.modmuss50.optifabric.compat.borderlessmining.BorderlessMiningNewMixinPlugin", | ||
"mixins": [ | ||
"VideoOptionsScreenMixin", | ||
"OptionFullscreenResolutionNewMixin" | ||
] | ||
} |