From 8a45e373321051e6d02462d82a940b55aba84d44 Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Mon, 12 Dec 2022 08:59:43 -0500 Subject: [PATCH] stop using at for GuiIngame --- build.gradle | 3 +- .../chat/modules/triggers/AutoVictory.java | 5 +- .../hytils/mixin/GuiIngameAccessor.java | 33 ++++++++++ src/main/resources/hytils_at.cfg | 5 +- src/main/resources/mixins.hytils.json | 63 ++++++++++--------- 5 files changed, 70 insertions(+), 39 deletions(-) create mode 100644 src/main/java/cc/woverflow/hytils/mixin/GuiIngameAccessor.java diff --git a/build.gradle b/build.gradle index 3ba36dd9..da85b7e6 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,6 @@ configurations { repositories { maven { url 'https://repo.polyfrost.cc/releases' } - maven { url = "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1" } } dependencies { @@ -58,7 +57,7 @@ dependencies { mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") - compileOnly('cc.polyfrost:oneconfig-1.8.9-forge:0.1.0-alpha114') + compileOnly('cc.polyfrost:oneconfig-1.8.9-forge:0.1.0-alpha+') include('cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-alpha+') compileOnly('org.spongepowered:mixin:0.7.11-SNAPSHOT') diff --git a/src/main/java/cc/woverflow/hytils/handlers/chat/modules/triggers/AutoVictory.java b/src/main/java/cc/woverflow/hytils/handlers/chat/modules/triggers/AutoVictory.java index fef5adfd..c790aa20 100644 --- a/src/main/java/cc/woverflow/hytils/handlers/chat/modules/triggers/AutoVictory.java +++ b/src/main/java/cc/woverflow/hytils/handlers/chat/modules/triggers/AutoVictory.java @@ -28,6 +28,7 @@ import cc.woverflow.hytils.events.TitleEvent; import cc.woverflow.hytils.handlers.cache.PatternHandler; import cc.woverflow.hytils.handlers.chat.ChatReceiveResetModule; +import cc.woverflow.hytils.mixin.GuiIngameAccessor; import cc.woverflow.hytils.util.HypixelAPIUtils; import net.minecraft.client.Minecraft; import net.minecraft.util.EnumChatFormatting; @@ -138,8 +139,8 @@ private void doNotification() { @Override public void reset() { victoryDetected = false; - Minecraft.getMinecraft().ingameGUI.displayedTitle = ""; - Minecraft.getMinecraft().ingameGUI.displayedSubTitle = ""; + ((GuiIngameAccessor) Minecraft.getMinecraft().ingameGUI).setDisplayedTitle(""); + ((GuiIngameAccessor) Minecraft.getMinecraft().ingameGUI).setDisplayedSubTitle(""); } private boolean isSupportedMode(LocrawInfo locraw) { diff --git a/src/main/java/cc/woverflow/hytils/mixin/GuiIngameAccessor.java b/src/main/java/cc/woverflow/hytils/mixin/GuiIngameAccessor.java new file mode 100644 index 00000000..1e6da842 --- /dev/null +++ b/src/main/java/cc/woverflow/hytils/mixin/GuiIngameAccessor.java @@ -0,0 +1,33 @@ +/* + * Hytils Reborn - Hypixel focused Quality of Life mod. + * Copyright (C) 2022 W-OVERFLOW + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package cc.woverflow.hytils.mixin; + +import net.minecraft.client.gui.GuiIngame; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(GuiIngame.class) +public interface GuiIngameAccessor { + + @Accessor("displayedTitle") + void setDisplayedTitle(String title); + + @Accessor("displayedSubTitle") + void setDisplayedSubTitle(String subtitle); +} diff --git a/src/main/resources/hytils_at.cfg b/src/main/resources/hytils_at.cfg index d3125835..6a3d2a55 100644 --- a/src/main/resources/hytils_at.cfg +++ b/src/main/resources/hytils_at.cfg @@ -1,4 +1 @@ -public net.minecraft.client.renderer.BlockModelRenderer$AmbientOcclusionFace - -public net.minecraft.client.gui.GuiIngame field_175201_x -public net.minecraft.client.gui.GuiIngame field_175200_y \ No newline at end of file +public net.minecraft.client.renderer.BlockModelRenderer$AmbientOcclusionFace \ No newline at end of file diff --git a/src/main/resources/mixins.hytils.json b/src/main/resources/mixins.hytils.json index 7fb33980..c2a1a225 100644 --- a/src/main/resources/mixins.hytils.json +++ b/src/main/resources/mixins.hytils.json @@ -1,33 +1,34 @@ { - "compatibilityLevel": "JAVA_8", - "minVersion": "0.7", - "package": "cc.woverflow.hytils.mixin", - "plugin": "cc.woverflow.hytils.forge.HytilsMixinPlugin", - "refmap": "mixins.hytils.refmap.json", - "verbose": true, - "client": [ - "beds.ModelLoaderMixin", - "CommandLimboMixin_FixCommand", - "EntityLivingBaseMixin_MiningFatigue", - "EntityPlayerSPMixin_MessageHandling", - "GuiChatMixin_PlayAutocomplete", - "GuiIngameForgeMixin_HideActionbar", - "GuiIngameForgeMixin_TitleEvent", - "GuiNewChatAccessor", - "GuiNewChatMixin_LocrawHider", - "GuiPlayerTabOverlayMixin_HideNPCs", - "GuiPlayerTabOverlayMixin_HidePing", - "LayerArmorBaseMixin_HideIngameArmour", - "MinecraftMixin_LeftClickInteract", - "MinecraftMixin_LimboLimiter", - "NetHandlerPlayClientMixin_GameChecker", - "RenderEntityItemMixin_UHCOverlay", - "cosmetics.RenderItemMixin", - "cosmetics.WorldMixin", - "lineseparator.GuiNewChatMixin", - "lineseparator.GuiUtilRenderComponentsMixin", - "overlay.BlockModelRendererMixin_NoOptiFine", - "overlay.BlockModelRendererMixin_OptiFine", - "overlay.VertexLighterFlatMixin" - ] + "compatibilityLevel": "JAVA_8", + "minVersion": "0.7", + "package": "cc.woverflow.hytils.mixin", + "plugin": "cc.woverflow.hytils.forge.HytilsMixinPlugin", + "refmap": "mixins.hytils.refmap.json", + "verbose": true, + "client": [ + "CommandLimboMixin_FixCommand", + "EntityLivingBaseMixin_MiningFatigue", + "EntityPlayerSPMixin_MessageHandling", + "GuiChatMixin_PlayAutocomplete", + "GuiIngameAccessor", + "GuiIngameForgeMixin_HideActionbar", + "GuiIngameForgeMixin_TitleEvent", + "GuiNewChatAccessor", + "GuiNewChatMixin_LocrawHider", + "GuiPlayerTabOverlayMixin_HideNPCs", + "GuiPlayerTabOverlayMixin_HidePing", + "LayerArmorBaseMixin_HideIngameArmour", + "MinecraftMixin_LeftClickInteract", + "MinecraftMixin_LimboLimiter", + "NetHandlerPlayClientMixin_GameChecker", + "RenderEntityItemMixin_UHCOverlay", + "beds.ModelLoaderMixin", + "cosmetics.RenderItemMixin", + "cosmetics.WorldMixin", + "lineseparator.GuiNewChatMixin", + "lineseparator.GuiUtilRenderComponentsMixin", + "overlay.BlockModelRendererMixin_NoOptiFine", + "overlay.BlockModelRendererMixin_OptiFine", + "overlay.VertexLighterFlatMixin" + ] } \ No newline at end of file