diff --git a/src/main/java/com/mitchej123/hodgepodge/Hodgepodge.java b/src/main/java/com/mitchej123/hodgepodge/Hodgepodge.java index 4afd6ed8..0a694185 100644 --- a/src/main/java/com/mitchej123/hodgepodge/Hodgepodge.java +++ b/src/main/java/com/mitchej123/hodgepodge/Hodgepodge.java @@ -29,7 +29,7 @@ version = Hodgepodge.VERSION, name = Hodgepodge.NAME, dependencies = "required-after:gtnhmixins@[2.0.1,);" + "required-after:unimixins@[0.0.14,);" - + "required-after:gtnhlib@[0.2.2,);", + + "required-after:gtnhlib@[0.5.15,);", guiFactory = "com.mitchej123.hodgepodge.config.gui.HodgepodgeGuiConfigFactory") public class Hodgepodge { diff --git a/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java b/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java index ba5ad7ac..118006fe 100644 --- a/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java +++ b/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java @@ -363,6 +363,11 @@ public class FixesConfig { @Config.RequiresMcRestart public static boolean fixGameSettingsArrayOutOfBounds; + @Config.Comment("Fix the vanilla method to open chat links not working for every OS") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean fixChatOpenLink; + /* ====== Minecraft fixes end ===== */ // affecting multiple mods diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java b/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java index 336a79a2..07b78508 100644 --- a/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java @@ -431,6 +431,10 @@ public enum Mixins { .addMixinClasses("minecraft.MixinWorldServer_LimitUpdateRecursion") .setApplyIf(() -> FixesConfig.limitRecursiveBlockUpdateDepth >= 0)), + FIX_CHAT_OPEN_LINK(new Builder("Fix the vanilla method to open chat links not working for every OS") + .setPhase(Phase.EARLY).setSide(Side.CLIENT).addTargetedMod(TargetedMod.VANILLA) + .addMixinClasses("minecraft.MixinGuiChat_OpenLinks").setApplyIf(() -> FixesConfig.fixChatOpenLink)), + // Ic2 adjustments IC2_UNPROTECTED_GET_BLOCK_FIX(new Builder("IC2 Kinetic Fix").setPhase(Phase.EARLY).setSide(Side.BOTH) .addMixinClasses("ic2.MixinIc2WaterKinetic").setApplyIf(() -> FixesConfig.fixIc2UnprotectedGetBlock) diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinGuiChat_OpenLinks.java b/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinGuiChat_OpenLinks.java new file mode 100644 index 00000000..7ebfcab0 --- /dev/null +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinGuiChat_OpenLinks.java @@ -0,0 +1,24 @@ +package com.mitchej123.hodgepodge.mixins.early.minecraft; + +import java.net.URI; + +import net.minecraft.client.gui.GuiChat; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +import com.gtnewhorizon.gtnhlib.util.FilesUtil; + +@Mixin(GuiChat.class) +public class MixinGuiChat_OpenLinks { + + /** + * @author Alexdoru + * @reason The Vanilla method doesn't work on some OS + */ + @Overwrite + private void func_146407_a(URI uri) { + FilesUtil.openUri(uri); + } + +}