diff --git a/1.20/src/main/java/io/github/axolotlclient/AxolotlClient.java b/1.20/src/main/java/io/github/axolotlclient/AxolotlClient.java index 15ed76b02..b2628d7f5 100644 --- a/1.20/src/main/java/io/github/axolotlclient/AxolotlClient.java +++ b/1.20/src/main/java/io/github/axolotlclient/AxolotlClient.java @@ -70,8 +70,6 @@ import org.quiltmc.loader.api.QuiltLoader; import org.quiltmc.qsl.base.api.entrypoint.client.ClientModInitializer; import org.quiltmc.qsl.lifecycle.api.client.event.ClientTickEvents; -import org.quiltmc.qsl.resource.loader.api.ResourceLoader; -import org.quiltmc.qsl.resource.loader.api.ResourcePackActivationType; public class AxolotlClient implements ClientModInitializer { @@ -187,8 +185,6 @@ public void onInitializeClient(ModContainer container) { modules.forEach(Module::lateInit); - ResourceLoader.registerBuiltinResourcePack(new Identifier("axolotlclient", "axolotlclient-ui"), container, - ResourcePackActivationType.NORMAL); ClientTickEvents.END.register(client -> tickClient()); FeatureDisabler.init(); diff --git a/1.20/src/main/java/io/github/axolotlclient/config/screen/CreditsScreen.java b/1.20/src/main/java/io/github/axolotlclient/config/screen/CreditsScreen.java index 93210e2ac..726a24340 100644 --- a/1.20/src/main/java/io/github/axolotlclient/config/screen/CreditsScreen.java +++ b/1.20/src/main/java/io/github/axolotlclient/config/screen/CreditsScreen.java @@ -40,9 +40,9 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.gui.screen.narration.NarrationPart; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.gui.widget.ElementListWidget; -import net.minecraft.client.gui.widget.EntryListWidget; +import net.minecraft.client.gui.widget.button.ButtonWidget; +import net.minecraft.client.gui.widget.list.ElementListWidget; +import net.minecraft.client.gui.widget.list.EntryListWidget; import net.minecraft.client.resource.language.I18n; import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.client.sound.SoundInstance; @@ -75,16 +75,6 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float tickDelta MinecraftClient.getInstance().getSoundManager().play(bgm); } - renderBackground(graphics); - if (AxolotlClient.someNiceBackground.get()) { // Credit to pridelib for the colors - graphics.fill(0, 0, width, height / 6, 0xFFff0018); - graphics.fill(0, height / 6, width, height * 2 / 6, 0xFFffa52c); - graphics.fill(0, height * 2 / 6, width, height / 2, 0xFFffff41); - graphics.fill(0, height * 2 / 3, width, height * 5 / 6, 0xFF0000f9); - graphics.fill(0, height / 2, width, height * 2 / 3, 0xFF008018); - graphics.fill(0, height * 5 / 6, width, height, 0xFF86007d); - } - super.render(graphics, mouseX, mouseY, tickDelta); DrawUtil.drawCenteredString(graphics, this.textRenderer, I18n.translate("credits"), width / 2, 20, -1, true); @@ -96,6 +86,19 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float tickDelta } } + @Override + public void renderBackground(GuiGraphics graphics, int mouseX, int mouseY, float delta) { + super.renderBackground(graphics, mouseX, mouseY, delta); + if (AxolotlClient.someNiceBackground.get()) { // Credit to pridelib for the colors + graphics.fill(0, 0, width, height / 6, 0xFFff0018); + graphics.fill(0, height / 6, width, height * 2 / 6, 0xFFffa52c); + graphics.fill(0, height * 2 / 6, width, height / 2, 0xFFffff41); + graphics.fill(0, height * 2 / 3, width, height * 5 / 6, 0xFF0000f9); + graphics.fill(0, height / 2, width, height * 2 / 3, 0xFF008018); + graphics.fill(0, height * 5 / 6, width, height, 0xFF86007d); + } + } + @Override public boolean keyPressed(int keyCode, int scanCode, int modifiers) { if (keyCode == InputUtil.KEY_ESCAPE_CODE) { @@ -125,9 +128,9 @@ public void init() { initCredits(); creditsList = new CreditsList(client, width, height, 50, height - 50, 25); - addSelectableChild(creditsList); + addSelectableElement(creditsList); - this.addDrawableChild(new ButtonWidget.Builder(CommonTexts.BACK, buttonWidget -> { + this.addDrawableSelectableElement(new ButtonWidget.Builder(CommonTexts.BACK, buttonWidget -> { if (creditOverlay == null) { MinecraftClient.getInstance().setScreen(parent); stopBGM(); @@ -136,7 +139,7 @@ public void init() { } }).positionAndSize(width / 2 - 75, height - 50 + 22, 150, 20).build()); - this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("creditsBGM").append(": ") + this.addDrawableSelectableElement(new ButtonWidget.Builder(Text.translatable("creditsBGM").append(": ") .append(Text.translatable(AxolotlClient.CONFIG.creditsBGM.get() ? "options.on" : "options.off")), buttonWidget -> { AxolotlClient.CONFIG.creditsBGM.toggle(); @@ -207,8 +210,8 @@ public boolean mouseDragged(double mouseX, double mouseY, int button, double del } @Override - public boolean mouseScrolled(double mouseX, double mouseY, double amount) { - return super.mouseScrolled(mouseX, mouseY, amount) || creditsList.mouseScrolled(mouseX, mouseY, amount); + public boolean mouseScrolled(double mouseX, double mouseY, double amountX, double amountY) { + return super.mouseScrolled(mouseX, mouseY, amountX, amountY) || creditsList.mouseScrolled(mouseX, mouseY, amountX, amountY); } private class CreditsList extends ElementListWidget { @@ -218,7 +221,6 @@ public CreditsList(MinecraftClient minecraftClient, int width, int height, int t super(minecraftClient, width, height, top, bottom, entryHeight); this.setRenderBackground(false); - this.setRenderHorizontalShadows(false); this.setRenderHeader(false, 0); for (Credit c : credits) { diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/BossBarHudAccessor.java b/1.20/src/main/java/io/github/axolotlclient/mixin/BossBarHudAccessor.java index 3404b43f8..edb5354b6 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/BossBarHudAccessor.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/BossBarHudAccessor.java @@ -25,8 +25,8 @@ import java.util.Map; import java.util.UUID; -import net.minecraft.client.gui.hud.BossBarHud; -import net.minecraft.client.gui.hud.ClientBossBar; +import net.minecraft.client.gui.hud.boss_bar.BossBarHud; +import net.minecraft.client.gui.hud.boss_bar.ClientBossBar; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/BossBarHudMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/BossBarHudMixin.java index c308c5eca..af7c002b4 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/BossBarHudMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/BossBarHudMixin.java @@ -30,7 +30,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -@Mixin(net.minecraft.client.gui.hud.BossBarHud.class) +@Mixin(net.minecraft.client.gui.hud.boss_bar.BossBarHud.class) public abstract class BossBarHudMixin { @Inject(method = "render", at = @At("HEAD"), cancellable = true) diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/ChatHudMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/ChatHudMixin.java index 968498873..a8b450e80 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/ChatHudMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/ChatHudMixin.java @@ -25,8 +25,8 @@ import io.github.axolotlclient.modules.hypixel.nickhider.NickHider; import io.github.axolotlclient.util.events.Events; import io.github.axolotlclient.util.events.impl.ReceiveChatMessageEvent; -import net.minecraft.client.gui.hud.ChatHud; -import net.minecraft.client.gui.hud.ChatMessageTag; +import net.minecraft.client.gui.hud.chat.ChatHud; +import net.minecraft.client.gui.hud.chat.ChatMessageTag; import net.minecraft.network.message.MessageSignature; import net.minecraft.text.Text; import org.spongepowered.asm.mixin.Mixin; @@ -39,14 +39,14 @@ @Mixin(ChatHud.class) public abstract class ChatHudMixin { - @Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignature;Lnet/minecraft/client/gui/hud/ChatMessageTag;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;logChatMessage(Lnet/minecraft/text/Text;Lnet/minecraft/client/gui/hud/ChatMessageTag;)V"), cancellable = true) + @Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignature;Lnet/minecraft/client/gui/hud/chat/ChatMessageTag;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/chat/ChatHud;logChatMessage(Lnet/minecraft/text/Text;Lnet/minecraft/client/gui/hud/chat/ChatMessageTag;)V"), cancellable = true) public void axolotlclient$autoThings(Text message, MessageSignature signature, ChatMessageTag tag, CallbackInfo ci) { if (message == null) { ci.cancel(); } } - @ModifyVariable(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignature;Lnet/minecraft/client/gui/hud/ChatMessageTag;)V", at = @At("HEAD"), argsOnly = true) + @ModifyVariable(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignature;Lnet/minecraft/client/gui/hud/chat/ChatMessageTag;)V", at = @At("HEAD"), argsOnly = true) private Text axolotlclient$onChatMessage(Text message) { ReceiveChatMessageEvent event = new ReceiveChatMessageEvent(false, message.getString(), message); Events.RECEIVE_CHAT_MESSAGE_EVENT.invoker().invoke(event); @@ -58,7 +58,7 @@ public abstract class ChatHudMixin { return message; } - @ModifyArg(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignature;Lnet/minecraft/client/gui/hud/ChatMessageTag;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignature;ILnet/minecraft/client/gui/hud/ChatMessageTag;Z)V"), index = 0) + @ModifyArg(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignature;Lnet/minecraft/client/gui/hud/chat/ChatMessageTag;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/chat/ChatHud;addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignature;ILnet/minecraft/client/gui/hud/chat/ChatMessageTag;Z)V"), index = 0) public Text axolotlclient$editChat(Text message) { return NickHider.getInstance().editMessage(message); } diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/DebugHudMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/DebugHudMixin.java index 4536df5bf..a5e4fdff3 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/DebugHudMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/DebugHudMixin.java @@ -25,7 +25,7 @@ import io.github.axolotlclient.modules.hud.HudManager; import io.github.axolotlclient.modules.hud.gui.hud.vanilla.CrosshairHud; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.hud.DebugHud; +import net.minecraft.client.gui.hud.debug.DebugHud; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/GameMenuScreenMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/GameMenuScreenMixin.java index 9923a30d2..1fd9e5e7f 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/GameMenuScreenMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/GameMenuScreenMixin.java @@ -30,7 +30,7 @@ import io.github.axolotlclient.modules.hypixel.HypixelMods; import net.minecraft.client.gui.screen.GameMenuScreen; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.button.ButtonWidget; import net.minecraft.text.Text; import org.quiltmc.loader.api.QuiltLoader; import org.spongepowered.asm.mixin.Mixin; @@ -42,7 +42,7 @@ @Mixin(GameMenuScreen.class) public abstract class GameMenuScreenMixin { - @Redirect(method = "initWidgets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/GameMenuScreen;createLinkConfirmationButton(Lnet/minecraft/text/Text;Ljava/lang/String;)Lnet/minecraft/client/gui/widget/ButtonWidget;", ordinal = 1)) + @Redirect(method = "initWidgets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/GameMenuScreen;createLinkConfirmationButton(Lnet/minecraft/text/Text;Ljava/lang/String;)Lnet/minecraft/client/gui/widget/button/ButtonWidget;", ordinal = 1)) private ButtonWidget axolotlclient$addClientOptionsButton(GameMenuScreen instance, Text text, String string) { if (axolotlclient$hasModMenu()) return createLinkConfirmationButton(text, string); @@ -60,7 +60,7 @@ public abstract class GameMenuScreenMixin { @Shadow protected abstract ButtonWidget createButton(Text par1, Supplier par2); - @ModifyArg(method = "initWidgets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/ButtonWidget;builder(Lnet/minecraft/text/Text;Lnet/minecraft/client/gui/widget/ButtonWidget$PressAction;)Lnet/minecraft/client/gui/widget/ButtonWidget$Builder;", ordinal = 1), index = 1) + @ModifyArg(method = "initWidgets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/button/ButtonWidget;builder(Lnet/minecraft/text/Text;Lnet/minecraft/client/gui/widget/button/ButtonWidget$PressAction;)Lnet/minecraft/client/gui/widget/button/ButtonWidget$Builder;", ordinal = 1), index = 1) private ButtonWidget.PressAction axolotlclient$clearFeatureRestrictions(ButtonWidget.PressAction onPress) { return (buttonWidget) -> { if (Objects.equals(HypixelMods.getInstance().cacheMode.get(), diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/GameRendererMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/GameRendererMixin.java index 360881782..6b620ea6b 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/GameRendererMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/GameRendererMixin.java @@ -112,7 +112,7 @@ public abstract class GameRendererMixin { } } - @Inject(method = "bobViewWhenHurt", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;getCameraEntity()Lnet/minecraft/entity/Entity;", ordinal = 1), cancellable = true) + @Inject(method = "bobViewWhenHurt", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;getCameraEntity()Lnet/minecraft/entity/Entity;"), cancellable = true) private void axolotlclient$noHurtCam(MatrixStack matrixStack, float f, CallbackInfo ci){ if(AxolotlClient.CONFIG.noHurtCam.get()){ ci.cancel(); diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/InGameHudMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/InGameHudMixin.java index b43cc3fa5..a932ea425 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/InGameHudMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/InGameHudMixin.java @@ -35,7 +35,7 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.hud.InGameHud; +import net.minecraft.client.gui.hud.in_game.InGameHud; import net.minecraft.entity.Entity; import net.minecraft.scoreboard.ScoreboardObjective; import net.minecraft.text.StringVisitable; @@ -62,7 +62,7 @@ public abstract class InGameHudMixin { @Shadow private int overlayRemaining; - @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderStatusEffectOverlay(Lnet/minecraft/client/gui/GuiGraphics;)V")) + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/in_game/InGameHud;renderStatusEffectOverlay(Lnet/minecraft/client/gui/GuiGraphics;)V")) private void axolotlclient$onHudRender(GuiGraphics graphics, float tickDelta, CallbackInfo ci) { if (!MinecraftClient.getInstance().options.hudHidden) { HudManager.getInstance().render(graphics, tickDelta); @@ -81,7 +81,7 @@ public abstract class InGameHudMixin { public void axolotlclient$renderCrosshair(GuiGraphics graphics, CallbackInfo ci) { CrosshairHud hud = (CrosshairHud) HudManager.getInstance().get(CrosshairHud.ID); if (hud != null && hud.isEnabled()) { - if (MinecraftClient.getInstance().options.debugEnabled && !hud.overridesF3()) { + if (MinecraftClient.getInstance().method_53526().chartsVisible() && !hud.overridesF3()) { return; } ci.cancel(); @@ -98,7 +98,7 @@ public abstract class InGameHudMixin { } } - @Inject(method = "render", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/InGameHud;overlayMessage:Lnet/minecraft/text/Text;", ordinal = 0)) + @Inject(method = "render", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/in_game/InGameHud;overlayMessage:Lnet/minecraft/text/Text;", ordinal = 0)) public void axolotlclient$clearActionBar(GuiGraphics graphics, float tickDelta, CallbackInfo ci) { ActionBarHud hud = (ActionBarHud) HudManager.getInstance().get(ActionBarHud.ID); if (hud != null && hud.isEnabled()) { @@ -138,7 +138,7 @@ public abstract class InGameHudMixin { } } - @ModifyArgs(method = "renderMountJumpBar", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;drawTexture(Lnet/minecraft/util/Identifier;IIIIII)V")) + @ModifyArgs(method = "renderMountJumpBar", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;drawGuiTexture(Lnet/minecraft/util/Identifier;IIII)V")) public void axolotlclient$moveHorseHealth(Args args) { HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID); if (hud.isEnabled()) { @@ -147,7 +147,7 @@ public abstract class InGameHudMixin { } } - @ModifyArgs(method = "renderExperienceBar", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;drawTexture(Lnet/minecraft/util/Identifier;IIIIII)V")) + @ModifyArgs(method = "renderExperienceBar", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;drawGuiTexture(Lnet/minecraft/util/Identifier;IIII)V")) public void axolotlclient$moveXPBar(Args args) { HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID); if (hud.isEnabled()) { @@ -156,7 +156,7 @@ public abstract class InGameHudMixin { } } - @Redirect(method = "renderExperienceBar", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledHeight:I")) + @Redirect(method = "renderExperienceBar", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/in_game/InGameHud;scaledHeight:I")) public int axolotlclient$moveXPBarHeight(InGameHud instance) { HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID); if (hud.isEnabled()) { @@ -165,7 +165,7 @@ public abstract class InGameHudMixin { return scaledHeight; } - @Redirect(method = "renderExperienceBar", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledWidth:I")) + @Redirect(method = "renderExperienceBar", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/in_game/InGameHud;scaledWidth:I")) public int axolotlclient$moveXPBarWidth(InGameHud instance) { HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID); if (hud.isEnabled()) { @@ -174,7 +174,7 @@ public abstract class InGameHudMixin { return scaledWidth; } - @Redirect(method = "renderStatusBars", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledHeight:I")) + @Redirect(method = "renderStatusBars", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/in_game/InGameHud;scaledHeight:I")) public int axolotlclient$moveStatusBarsHeight(InGameHud instance) { HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID); if (hud.isEnabled()) { @@ -183,7 +183,7 @@ public abstract class InGameHudMixin { return scaledHeight; } - @Redirect(method = "renderStatusBars", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledWidth:I")) + @Redirect(method = "renderStatusBars", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/in_game/InGameHud;scaledWidth:I")) public int axolotlclient$moveStatusBarsWidth(InGameHud instance) { HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID); if (hud.isEnabled()) { diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/InGameOverlayRendererMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/InGameOverlayRendererMixin.java index d2f6ff703..e9b504cf2 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/InGameOverlayRendererMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/InGameOverlayRendererMixin.java @@ -24,7 +24,7 @@ import io.github.axolotlclient.AxolotlClient; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.hud.InGameOverlayRenderer; +import net.minecraft.client.gui.hud.in_game.InGameOverlayRenderer; import net.minecraft.client.util.math.MatrixStack; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/MinecraftClientAccessor.java b/1.20/src/main/java/io/github/axolotlclient/mixin/MinecraftClientAccessor.java index 08fb44deb..43eb4fe1d 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/MinecraftClientAccessor.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/MinecraftClientAccessor.java @@ -23,6 +23,7 @@ package io.github.axolotlclient.mixin; import com.mojang.authlib.minecraft.UserApiService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; import net.minecraft.client.MinecraftClient; import net.minecraft.client.multiplayer.report.chat.ChatReportingContext; import net.minecraft.client.network.SocialInteractionsManager; @@ -59,4 +60,7 @@ static int getCurrentFps() { @Accessor @Mutable void setUserApiService(UserApiService service); + + @Accessor + YggdrasilAuthenticationService getAuthService(); } diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/MouseMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/MouseMixin.java index 8b962b876..7aa4eecd7 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/MouseMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/MouseMixin.java @@ -44,7 +44,7 @@ public abstract class MouseMixin { } } - @Inject(method = "onMouseScroll", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;mouseScrolled(DDD)Z")) + @Inject(method = "onMouseScroll", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;mouseScrolled(DDDD)Z")) public void axolotlclient$scrollTooltips(long window, double scrollDeltaX, double scrollDeltaY, CallbackInfo ci) { if (ScrollableTooltips.getInstance().enabled.get() && Math.signum(scrollDeltaY) != 0) { ScrollableTooltips.getInstance().onScroll(Math.signum(scrollDeltaY) > 0); diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/PlayerListEntryMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/PlayerListEntryMixin.java index 32d87c695..8844a5938 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/PlayerListEntryMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/PlayerListEntryMixin.java @@ -26,8 +26,8 @@ import io.github.axolotlclient.modules.hypixel.nickhider.NickHider; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.PlayerListEntry; +import net.minecraft.client.texture.PlayerSkin; import net.minecraft.client.util.DefaultSkinHelper; -import net.minecraft.util.Identifier; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -42,14 +42,14 @@ public abstract class PlayerListEntryMixin { @Final private GameProfile profile; - @Inject(method = "getSkinTexture", at = @At("RETURN"), cancellable = true) - public void axolotlclient$hideSkins(CallbackInfoReturnable cir) { + @Inject(method = "getSkin", at = @At("RETURN"), cancellable = true) + private void axolotlclient$hideSkins(CallbackInfoReturnable cir) { if (profile.equals(MinecraftClient.getInstance().player.getGameProfile()) && NickHider.getInstance().hideOwnSkin.get()) { - cir.setReturnValue(DefaultSkinHelper.getTexture(profile.getId())); + cir.setReturnValue(DefaultSkinHelper.getSkin(profile)); } else if (!profile.equals(MinecraftClient.getInstance().player.getGameProfile()) && NickHider.getInstance().hideOtherSkins.get()) { - cir.setReturnValue(DefaultSkinHelper.getTexture(profile.getId())); + cir.setReturnValue(DefaultSkinHelper.getSkin(profile)); } } } diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/ScreenMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/ScreenMixin.java index 6226b4300..ecaf72427 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/ScreenMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/ScreenMixin.java @@ -46,7 +46,7 @@ public abstract class ScreenMixin { } } - @Inject(method = "renderBackground", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;fillGradient(IIIIII)V"), cancellable = true) + @Inject(method = "renderWorldOverlayBackground", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;fillGradient(IIIIII)V"), cancellable = true) private void axolotlclient$menuBlur(GuiGraphics graphics, CallbackInfo ci) { if (MenuBlur.getInstance().renderScreen(graphics)) { ci.cancel(); diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/TitleScreenMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/TitleScreenMixin.java index 8e5f5f255..a63bc0f49 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/TitleScreenMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/TitleScreenMixin.java @@ -35,8 +35,8 @@ import net.minecraft.client.gui.screen.ConfirmScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.TitleScreen; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.realms.gui.screen.RealmsNotificationsScreen; +import net.minecraft.client.gui.screen.realms.RealmsNotificationsScreen; +import net.minecraft.client.gui.widget.button.ButtonWidget; import net.minecraft.text.Text; import net.minecraft.util.Formatting; import org.jetbrains.annotations.Nullable; @@ -69,7 +69,7 @@ protected TitleScreenMixin() { AxolotlClient.LOGGER.info("Unbound \"Save Toolbar Activator\" to resolve conflict with the zoom key!"); } if (Auth.getInstance().showButton.get()) { - addDrawableChild(new AuthWidget()); + addDrawableSelectableElement(new AuthWidget()); } } @@ -81,7 +81,7 @@ protected TitleScreenMixin() { @ModifyArgs(method = "initWidgetsNormal", at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/gui/widget/ButtonWidget;builder(Lnet/minecraft/text/Text;Lnet/minecraft/client/gui/widget/ButtonWidget$PressAction;)Lnet/minecraft/client/gui/widget/ButtonWidget$Builder;", ordinal = 2)) + target = "Lnet/minecraft/client/gui/widget/button/ButtonWidget;builder(Lnet/minecraft/text/Text;Lnet/minecraft/client/gui/widget/button/ButtonWidget$PressAction;)Lnet/minecraft/client/gui/widget/button/ButtonWidget$Builder;", ordinal = 2)) public void axolotlclient$noRealmsbutOptionsButton(Args args) { if (!QuiltLoader.isModLoaded("modmenu")) { args.set(0, Text.translatable("config")); diff --git a/1.20/src/main/java/io/github/axolotlclient/mixin/WorldListWidgetEntryMixin.java b/1.20/src/main/java/io/github/axolotlclient/mixin/WorldListWidgetEntryMixin.java index 757dd9683..35bd7ba23 100644 --- a/1.20/src/main/java/io/github/axolotlclient/mixin/WorldListWidgetEntryMixin.java +++ b/1.20/src/main/java/io/github/axolotlclient/mixin/WorldListWidgetEntryMixin.java @@ -23,7 +23,7 @@ package io.github.axolotlclient.mixin; import io.github.axolotlclient.modules.rpc.DiscordRPC; -import net.minecraft.client.gui.screen.world.WorldListWidget; +import net.minecraft.client.gui.widget.list.world.WorldEntryListWidget; import net.minecraft.world.storage.WorldSaveSummary; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -32,17 +32,17 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -@Mixin(WorldListWidget.Entry.class) +@Mixin(WorldEntryListWidget.WorldEntry.class) public abstract class WorldListWidgetEntryMixin { @Shadow @Final - private WorldSaveSummary level; + private WorldSaveSummary summary; @Inject(method = "play", at = @At("HEAD")) public void axolotlclient$onSPWorldJoin(CallbackInfo ci) { - if (!level.isUnavailable()) { - DiscordRPC.setWorld(level.getDisplayName()); + if (!summary.isUnavailable()) { + DiscordRPC.setWorld(summary.getDisplayName()); } } } diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/auth/AccountsListWidget.java b/1.20/src/main/java/io/github/axolotlclient/modules/auth/AccountsListWidget.java index 370c0cddf..9b6142fb6 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/auth/AccountsListWidget.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/auth/AccountsListWidget.java @@ -27,7 +27,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.widget.AlwaysSelectedEntryListWidget; +import net.minecraft.client.gui.widget.list.AlwaysSelectedEntryListWidget; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.Util; diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/auth/AccountsScreen.java b/1.20/src/main/java/io/github/axolotlclient/modules/auth/AccountsScreen.java index 8ae2ef736..bb5bc4cfc 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/auth/AccountsScreen.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/auth/AccountsScreen.java @@ -25,7 +25,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screen.ConfirmScreen; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.button.ButtonWidget; import net.minecraft.text.CommonTexts; import net.minecraft.text.Text; @@ -43,7 +43,6 @@ public AccountsScreen(Screen currentScreen) { @Override public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { - this.renderBackground(graphics); this.accountsListWidget.render(graphics, mouseX, mouseY, delta); graphics.drawCenteredShadowedText(this.textRenderer, this.title, this.width / 2, 20, 16777215); super.render(graphics, mouseX, mouseY, delta); @@ -72,14 +71,14 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { public void init() { accountsListWidget = new AccountsListWidget(this, client, width, height, 32, height - 64, 35); - addSelectableChild(accountsListWidget); + addSelectableElement(accountsListWidget); accountsListWidget.setAccounts(Auth.getInstance().getAccounts()); - addDrawableChild(loginButton = new ButtonWidget.Builder(Text.translatable("auth.login"), + addDrawableSelectableElement(loginButton = new ButtonWidget.Builder(Text.translatable("auth.login"), buttonWidget -> login()).positionAndSize(this.width / 2 - 154, this.height - 52, 150, 20).build()); - this.addDrawableChild(ButtonWidget.builder(Text.translatable("auth.add"), + this.addDrawableSelectableElement(ButtonWidget.builder(Text.translatable("auth.add"), button -> { if (!Auth.getInstance().allowOfflineAccounts()) { initMSAuth(); @@ -96,7 +95,7 @@ public void init() { }) .positionAndSize(this.width / 2 + 4, this.height - 52, 150, 20).build()); - this.deleteButton = this.addDrawableChild(ButtonWidget.builder(Text.translatable("selectServer.delete"), button -> { + this.deleteButton = this.addDrawableSelectableElement(ButtonWidget.builder(Text.translatable("selectServer.delete"), button -> { AccountsListWidget.Entry entry = this.accountsListWidget.getSelectedOrNull(); if (entry != null) { Auth.getInstance().removeAccount(entry.getAccount()); @@ -105,12 +104,12 @@ public void init() { }).positionAndSize(this.width / 2 - 50, this.height - 28, 100, 20).build()); - this.addDrawableChild(refreshButton = ButtonWidget.builder(Text.translatable("auth.refresh"), button -> refreshAccount()) + this.addDrawableSelectableElement(refreshButton = ButtonWidget.builder(Text.translatable("auth.refresh"), button -> refreshAccount()) .positionAndSize(this.width / 2 - 154, this.height - 28, 100, 20) .build() ); - this.addDrawableChild( + this.addDrawableSelectableElement( ButtonWidget.builder(CommonTexts.BACK, button -> this.client.setScreen(this.parent)) .positionAndSize(this.width / 2 + 4 + 50, this.height - 28, 100, 20) .build() diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/auth/AddOfflineScreen.java b/1.20/src/main/java/io/github/axolotlclient/modules/auth/AddOfflineScreen.java index bfb8c53b1..63c6abc29 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/auth/AddOfflineScreen.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/auth/AddOfflineScreen.java @@ -26,7 +26,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.button.ButtonWidget; import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.text.CommonTexts; import net.minecraft.text.Text; @@ -48,7 +48,6 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) { @Override public void render(GuiGraphics graphics, int i, int j, float f) { - renderBackground(graphics); super.render(graphics, i, j, f); graphics.drawShadowedText(textRenderer, Text.translatable("auth.add.offline.name"), width / 2 - 100, height / 2 - 20, -1); graphics.drawCenteredShadowedText(this.textRenderer, this.title, this.width / 2, 20, 16777215); @@ -62,10 +61,10 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { @Override public void init() { - addDrawableChild(nameInput = new TextFieldWidget(textRenderer, width / 2 - 100, height / 2 - 10, 200, 20, Text.empty())); + addDrawableSelectableElement(nameInput = new TextFieldWidget(textRenderer, width / 2 - 100, height / 2 - 10, 200, 20, Text.empty())); - addDrawableChild(new ButtonWidget.Builder(CommonTexts.CANCEL, button -> client.setScreen(parent)).positionAndSize(width / 2 - 155, height - 50, 150, 20).build()); - addDrawableChild(new ButtonWidget.Builder(CommonTexts.DONE, button -> { + addDrawableSelectableElement(new ButtonWidget.Builder(CommonTexts.CANCEL, button -> client.setScreen(parent)).positionAndSize(width / 2 - 155, height - 50, 150, 20).build()); + addDrawableSelectableElement(new ButtonWidget.Builder(CommonTexts.DONE, button -> { Auth.getInstance().addAccount(new MSAccount(nameInput.getText(), UUID.randomUUID().toString(), MSAccount.OFFLINE_TOKEN)); client.setScreen(parent); }).positionAndSize(width / 2 + 5, height - 50, 150, 20).build()); @@ -73,6 +72,6 @@ public void init() { @Override public void tick() { - nameInput.tick(); + } } diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/auth/Auth.java b/1.20/src/main/java/io/github/axolotlclient/modules/auth/Auth.java index 932a29e35..5d03861e2 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/auth/Auth.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/auth/Auth.java @@ -29,8 +29,8 @@ import com.mojang.authlib.exceptions.AuthenticationException; import com.mojang.authlib.minecraft.UserApiService; -import com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService; import com.mojang.blaze3d.texture.NativeImage; +import com.mojang.util.UndashedUuid; import io.github.axolotlclient.AxolotlClient; import io.github.axolotlclient.AxolotlClientConfig.options.BooleanOption; import io.github.axolotlclient.AxolotlClientConfig.options.GenericOption; @@ -63,14 +63,14 @@ public class Auth extends Accounts implements Module { public void init() { load(); this.auth = new MSAuth(AxolotlClient.LOGGER, this); - if (isContained(client.getSession().getUuid())) { - current = getAccounts().stream().filter(account -> account.getUuid().equals(client.getSession().getUuid())).toList().get(0); + if (isContained(UndashedUuid.toString(client.getSession().getPlayerUuid()))) { + current = getAccounts().stream().filter(account -> account.getUuid().equals(UndashedUuid.toString(client.getSession().getPlayerUuid()))).toList().get(0); if (current.isExpired()) { current.refresh(auth, () -> { }); } } else { - current = new MSAccount(client.getSession().getUsername(), client.getSession().getUuid(), client.getSession().getAccessToken()); + current = new MSAccount(client.getSession().getUsername(), UndashedUuid.toString(client.getSession().getPlayerUuid()), client.getSession().getAccessToken()); } OptionCategory category = new OptionCategory("auth"); @@ -91,14 +91,14 @@ protected void login(MSAccount account) { Runnable runnable = () -> { try { - ((MinecraftClientAccessor) client).setSession(new Session(account.getName(), account.getUuid(), account.getAuthToken(), + ((MinecraftClientAccessor) client).setSession(new Session(account.getName(), UndashedUuid.fromString(account.getUuid()), account.getAuthToken(), Optional.empty(), Optional.empty(), Session.AccountType.MSA)); UserApiService service; if (account.isOffline()) { service = UserApiService.OFFLINE; } else { - service = ((YggdrasilMinecraftSessionService) MinecraftClient.getInstance().getSessionService()).getAuthenticationService().createUserApiService(client.getSession().getAccessToken()); + service = ((MinecraftClientAccessor) MinecraftClient.getInstance()).getAuthService().createUserApiService(client.getSession().getAccessToken()); } ((MinecraftClientAccessor) client).setUserApiService(service); ((MinecraftClientAccessor) client).setSocialInteractionsManager(new SocialInteractionsManager(client, service)); diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/auth/AuthWidget.java b/1.20/src/main/java/io/github/axolotlclient/modules/auth/AuthWidget.java index b1b1c9ae4..ed8a1a321 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/auth/AuthWidget.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/auth/AuthWidget.java @@ -25,7 +25,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.button.ButtonWidget; import net.minecraft.text.Text; import net.minecraft.util.Identifier; diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/hud/HudEditScreen.java b/1.20/src/main/java/io/github/axolotlclient/modules/hud/HudEditScreen.java index a348be06a..1fcafa1b8 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/hud/HudEditScreen.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/hud/HudEditScreen.java @@ -22,11 +22,11 @@ package io.github.axolotlclient.modules.hud; -import java.awt.*; import java.util.List; import java.util.Optional; import io.github.axolotlclient.AxolotlClient; +import io.github.axolotlclient.AxolotlClientConfig.Color; import io.github.axolotlclient.AxolotlClientConfig.options.BooleanOption; import io.github.axolotlclient.AxolotlClientConfig.options.OptionCategory; import io.github.axolotlclient.AxolotlClientConfig.screen.OptionsScreenBuilder; @@ -37,7 +37,7 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.button.ButtonWidget; import net.minecraft.text.CommonTexts; import net.minecraft.text.Text; @@ -87,13 +87,6 @@ private void updateSnapState() { @Override public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { - if (MinecraftClient.getInstance().world != null) - graphics.fillGradient(0, 0, width, height, new Color(0xB0100E0E, true).hashCode(), - new Color(0x46212020, true).hashCode()); - else { - renderBackgroundTexture(graphics); - } - super.render(graphics, mouseX, mouseY, delta); Optional entry = HudManager.getInstance().getEntryXY(mouseX, mouseY); @@ -104,9 +97,19 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { } } + @Override + public void renderBackground(GuiGraphics graphics, int mouseX, int mouseY, float delta) { + if (MinecraftClient.getInstance().world != null) + graphics.fillGradient(0, 0, width, height, new Color(0xB0100E0E).getAsInt(), + new Color(0x46212020).getAsInt()); + else { + renderBackgroundTexture(graphics); + } + } + @Override public void init() { - this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("hud.snapping").append(": ") + this.addDrawableSelectableElement(new ButtonWidget.Builder(Text.translatable("hud.snapping").append(": ") .append(Text.translatable(snapping.get() ? "options.on" : "options.off")), buttonWidget -> { snapping.toggle(); @@ -115,16 +118,16 @@ public void init() { AxolotlClient.configManager.save(); }).positionAndSize(width / 2 - 50, height / 2 + 12, 100, 20).build()); - this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("hud.clientOptions"), + this.addDrawableSelectableElement(new ButtonWidget.Builder(Text.translatable("hud.clientOptions"), buttonWidget -> MinecraftClient.getInstance().setScreen(new OptionsScreenBuilder(this, (OptionCategory) new OptionCategory("config", false).addSubCategories(AxolotlClient.CONFIG.getCategories()), AxolotlClient.modid))).positionAndSize(width / 2 - 75, height / 2 - 10, 150, 20).build()); if (parent != null) - addDrawableChild(new ButtonWidget.Builder(CommonTexts.BACK, buttonWidget -> MinecraftClient.getInstance().setScreen(parent)) + addDrawableSelectableElement(new ButtonWidget.Builder(CommonTexts.BACK, buttonWidget -> MinecraftClient.getInstance().setScreen(parent)) .positionAndSize(width / 2 - 75, height - 50 + 22, 150, 20).build()); else - addDrawableChild(new ButtonWidget.Builder(Text.translatable("close"), + addDrawableSelectableElement(new ButtonWidget.Builder(Text.translatable("close"), buttonWidget -> MinecraftClient.getInstance().setScreen(null)) .positionAndSize(width / 2 - 75, height - 50 + 22, 150, 20).build()); } diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java b/1.20/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java index fc282797a..4c5f13038 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java @@ -139,7 +139,7 @@ public void render(GuiGraphics graphics, float delta) { client.getProfiler().push("Hud Modules"); if (!(client.currentScreen instanceof HudEditScreen)) { for (HudEntry hud : getEntries()) { - if (hud.isEnabled() && (!client.options.debugEnabled || hud.overridesF3())) { + if (hud.isEnabled() && (!client.method_53526().chartsVisible() || hud.overridesF3())) { client.getProfiler().push(hud.getName()); hud.render(graphics, delta); client.getProfiler().pop(); diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/KeystrokeHud.java b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/KeystrokeHud.java index e1f842da5..7b4ddebcf 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/KeystrokeHud.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/KeystrokeHud.java @@ -129,7 +129,7 @@ public void setKeystrokes() { (stroke.getFGColor().getAsInt() & 16579836) >> 2 | stroke.getFGColor().getAsInt() & -16777216)); } })); - KeyBind.unpressAll(); + KeyBind.resetAll(); KeyBind.updatePressedStates(); onMouseMovementOption(mouseMovement.get()); diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/PackDisplayHud.java b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/PackDisplayHud.java index 8b1920ddb..011d9c8e2 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/PackDisplayHud.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/PackDisplayHud.java @@ -83,7 +83,7 @@ public void renderComponent(GuiGraphics graphics, float f) { public void init() { int listSize = client.getResourcePackManager().getProfiles().size(); MinecraftClient.getInstance().getResourcePackManager().getEnabledProfiles().forEach(profile -> { - try (ResourcePack pack = profile.createResourcePack()) { + try (ResourcePack pack = profile.createPack()) { if (listSize == 1) { widgets.add(createWidget(profile.getDisplayName(), pack)); diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/PingHud.java b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/PingHud.java index 8264a9efd..6e896705f 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/PingHud.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/PingHud.java @@ -29,14 +29,13 @@ import io.github.axolotlclient.modules.hud.gui.entry.SimpleTextHudEntry; import io.github.axolotlclient.util.ThreadExecuter; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.hud.debug.PerformanceSampleLog; import net.minecraft.client.network.Address; import net.minecraft.client.network.AllowedAddressResolver; import net.minecraft.client.network.ServerAddress; import net.minecraft.client.network.ServerInfo; import net.minecraft.network.ClientConnection; -import net.minecraft.network.NetworkState; import net.minecraft.network.listener.ClientQueryPacketListener; -import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket; import net.minecraft.network.packet.c2s.query.MetadataQueryC2SPacket; import net.minecraft.network.packet.c2s.query.QueryPingC2SPacket; import net.minecraft.network.packet.s2c.query.QueryPongS2CPacket; @@ -102,23 +101,23 @@ private void getRealTimeServerPing(ServerInfo server) { var optional = AllowedAddressResolver.DEFAULT.resolve(address).map(Address::getInetSocketAddress); if (optional.isPresent()) { - ClientConnection manager = ClientConnection.connect(optional.get(), false); - manager.setPacketListener(new ClientQueryPacketListener() { + ClientConnection clientConnection = ClientConnection.connect(optional.get(), false, (PerformanceSampleLog) null); + ClientQueryPacketListener listener = new ClientQueryPacketListener() { private long currentSystemTime = 0L; @Override public void onServerMetadata(ServerMetadataS2CPacket packet) { this.currentSystemTime = net.minecraft.util.Util.getMeasuringTimeMs(); - manager.send(new QueryPingC2SPacket(this.currentSystemTime)); + clientConnection.send(new QueryPingC2SPacket(this.currentSystemTime)); } @Override - public void onPong(QueryPongS2CPacket packet) { + public void method_12666(QueryPongS2CPacket packet) { var time = this.currentSystemTime; var latency = net.minecraft.util.Util.getMeasuringTimeMs(); currentServerPing = (int) (latency - time); - manager.disconnect(Text.of("")); + clientConnection.disconnect(Text.translatable("multiplayer.status.finished")); } @Override @@ -127,11 +126,11 @@ public void onDisconnected(Text reason) { @Override public boolean isConnected() { - return manager.isOpen(); + return clientConnection.isOpen(); } - }); - manager.send(new HandshakeC2SPacket(address.getAddress(), address.getPort(), NetworkState.STATUS)); - manager.send(new MetadataQueryC2SPacket()); + }; + clientConnection.connect(address.getAddress(), address.getPort(), listener); + clientConnection.send(new MetadataQueryC2SPacket()); } } catch (Exception ignored) { } diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/BossBarHud.java b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/BossBarHud.java index 378e3a910..fdb862489 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/BossBarHud.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/BossBarHud.java @@ -37,7 +37,7 @@ import io.github.axolotlclient.modules.hud.util.DefaultOptions; import io.github.axolotlclient.modules.hud.util.DrawPosition; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.hud.ClientBossBar; +import net.minecraft.client.gui.hud.boss_bar.ClientBossBar; import net.minecraft.entity.boss.BossBar; import net.minecraft.text.Text; import net.minecraft.util.Identifier; diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/CrosshairHud.java b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/CrosshairHud.java index 7d054cb82..ab58c876b 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/CrosshairHud.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/CrosshairHud.java @@ -153,7 +153,7 @@ public void render(GuiGraphics graphics, float delta) { // Need to not enable blend while the debug HUD is open because it does weird stuff. Why? no idea. if (color == defaultColor.get() && !type.get().equals(Crosshair.DIRECTION.toString()) && applyBlend.get() - && !client.options.debugEnabled) { + && !client.method_53526().chartsVisible()) { RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.ONE_MINUS_DST_COLOR, GlStateManager.DestFactor.ONE_MINUS_SRC_COLOR, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/ScoreboardHud.java b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/ScoreboardHud.java index ca28ff94e..d7d6920f8 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/ScoreboardHud.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/ScoreboardHud.java @@ -66,7 +66,7 @@ public class ScoreboardHud extends TextHudEntry implements DynamicallyPositionab ScoreboardPlayerScore kode = placeScore.getPlayerScore("TheKodeToad", objective); kode.setScore(2948); - placeScore.setObjectiveSlot(1, objective); + placeScore.setObjectiveSlot(ScoreboardDisplaySlot.SIDEBAR, objective); return objective; }); @@ -98,12 +98,12 @@ public void renderComponent(GuiGraphics graphics, float delta) { if (team != null) { int t = team.getColor().getColorIndex(); if (t >= 0) { - scoreboardObjective = scoreboard.getObjectiveForSlot(3 + t); + scoreboardObjective = scoreboard.getObjectiveForSlot(ScoreboardDisplaySlot.fromFormatting(team.getColor())); } } ScoreboardObjective scoreboardObjective2 = scoreboardObjective != null ? scoreboardObjective - : scoreboard.getObjectiveForSlot(1); + : scoreboard.getObjectiveForSlot(ScoreboardDisplaySlot.SIDEBAR); if (scoreboardObjective2 != null) { this.renderScoreboardSidebar(graphics, scoreboardObjective2); } diff --git a/1.20/src/main/java/io/github/axolotlclient/modules/screenshotUtils/ImageViewerScreen.java b/1.20/src/main/java/io/github/axolotlclient/modules/screenshotUtils/ImageViewerScreen.java index 44fea3f92..5e9d3fc63 100644 --- a/1.20/src/main/java/io/github/axolotlclient/modules/screenshotUtils/ImageViewerScreen.java +++ b/1.20/src/main/java/io/github/axolotlclient/modules/screenshotUtils/ImageViewerScreen.java @@ -44,7 +44,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.tooltip.Tooltip; -import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.button.ButtonWidget; import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.client.resource.language.I18n; import net.minecraft.client.texture.NativeImageBackedTexture; @@ -76,8 +76,6 @@ public ImageViewerScreen(Screen parent) { @Override public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { - renderBackground(graphics); - super.render(graphics, mouseX, mouseY, delta); if (imageId != null) { @@ -131,9 +129,9 @@ protected void init() { if (!url.isEmpty()) { urlBox.setText(url); } - addDrawableChild(urlBox); + addDrawableSelectableElement(urlBox); - addDrawableChild(new ButtonWidget(width / 2 + 110, imageId == null ? height / 2 - 10 : height - 80, + addDrawableSelectableElement(new ButtonWidget(width / 2 + 110, imageId == null ? height / 2 - 10 : height - 80, 20, 20, Text.translatable("download"), buttonWidget -> { imageId = downloadImage(url = urlBox.getText()); clearAndInit(); @@ -146,7 +144,7 @@ public void drawWidget(GuiGraphics graphics, int mouseX, int mouseY, float delta } }); - addDrawableChild(ButtonWidget.builder(CommonTexts.BACK, + addDrawableSelectableElement(ButtonWidget.builder(CommonTexts.BACK, buttonWidget -> MinecraftClient.getInstance().setScreen(parent)) .position(width / 2 - 75, height - 50).build()); @@ -213,12 +211,12 @@ private Identifier downloadImage(String url) { } private void addImageButton(ButtonWidget button, boolean right) { - addSelectableChild(button); + addSelectableElement(button); editButtons.put(button, right); } @Override public void tick() { - urlBox.tick(); + } } diff --git a/1.20/src/main/java/io/github/axolotlclient/util/FeatureDisabler.java b/1.20/src/main/java/io/github/axolotlclient/util/FeatureDisabler.java index dfd191ff0..7ac69243e 100644 --- a/1.20/src/main/java/io/github/axolotlclient/util/FeatureDisabler.java +++ b/1.20/src/main/java/io/github/axolotlclient/util/FeatureDisabler.java @@ -73,16 +73,16 @@ public static void init() { ClientPlayConnectionEvents.DISCONNECT.register((handler, client) -> clear()); ClientPlayConnectionEvents.INIT.register((handler0, client0) -> - ClientPlayNetworking.registerGlobalReceiver(channelName, (client, handler, buf, responseSender) -> { - JsonArray array = JsonParser.parseString(buf.readString()).getAsJsonArray(); - for (JsonElement element : array) { - try { - features.get(element.getAsString()).setForceOff(true, "ban_reason"); - } catch (Exception e) { - AxolotlClient.LOGGER.error("Failed to disable " + element.getAsString() + "!"); + ClientPlayNetworking.registerGlobalReceiver(channelName, (client, handler, buf, responseSender) -> { + JsonArray array = JsonParser.parseString(buf.readString()).getAsJsonArray(); + for (JsonElement element : array) { + try { + features.get(element.getAsString()).setForceOff(true, "ban_reason"); + } catch (Exception e) { + AxolotlClient.LOGGER.error("Failed to disable " + element.getAsString() + "!"); + } } - } - }) + }) ); } diff --git a/1.20/src/main/java/io/github/axolotlclient/util/Util.java b/1.20/src/main/java/io/github/axolotlclient/util/Util.java index 1c6e5e45c..772c00bd0 100644 --- a/1.20/src/main/java/io/github/axolotlclient/util/Util.java +++ b/1.20/src/main/java/io/github/axolotlclient/util/Util.java @@ -29,10 +29,7 @@ import com.google.common.collect.Lists; import com.mojang.blaze3d.glfw.Window; import net.minecraft.client.MinecraftClient; -import net.minecraft.scoreboard.Scoreboard; -import net.minecraft.scoreboard.ScoreboardObjective; -import net.minecraft.scoreboard.ScoreboardPlayerScore; -import net.minecraft.scoreboard.Team; +import net.minecraft.scoreboard.*; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.ChatUtil; @@ -102,7 +99,7 @@ public static List getSidebar() { Scoreboard scoreboard = client.world.getScoreboard(); if (scoreboard == null) return lines; - ScoreboardObjective sidebar = scoreboard.getObjectiveForSlot(1); + ScoreboardObjective sidebar = scoreboard.getObjectiveForSlot(ScoreboardDisplaySlot.SIDEBAR); if (sidebar == null) return lines; diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dd8510ce..67dc81f48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -146,4 +146,5 @@ - add more Zoom keybinds - add option(s) to remove certain messages on hypixel (join, mystery box) -- Removed freelook on MCC island (#118 ) +- Removed freelook on MCC island (#118) +- update to 1.20.2 diff --git a/build.gradle b/build.gradle index 29b13980f..6e4f3f4d8 100644 --- a/build.gradle +++ b/build.gradle @@ -32,6 +32,10 @@ allprojects { url 'https://maven.terraformersmc.com/releases/' } + maven { + name = 'Quilt-Snapshots' + url = 'https://maven.quiltmc.org/repository/snapshot/' + } mavenLocal() maven { url 'https://jitpack.io' } mavenCentral() diff --git a/gradle.properties b/gradle.properties index 44619919c..2855a05ad 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,14 +7,14 @@ fabric.loom.multiProjectOptimisation=true axolotlclient.modules.all=true # Mod Properties -version=3.0.5 +version=3.0.6 maven_group=io.github.axolotlclient archives_base_name=AxolotlClient minecraft_1192=1.19.2 minecraft_1193=1.19.3 minecraft_1194=1.19.4 -minecraft_120=1.20.1 +minecraft_120=1.20.2 minecraft_18=1.8.9 minecraft_cts8=1.16_combat-6 minecraft_1165=1.16.5 @@ -24,13 +24,13 @@ mappings_1194=1.19.4+build.10 mappings_1192=1.19.2+build.21 mappings_cts8=1.16_combat-6+build.2 mappings_1165=1.16.5+build.10 -mappings_120=1.20.1+build.1 +mappings_120=1.20.2+build.3 quilt_loader=0.19.1 fabric_loader=0.14.21 qsl_1192=3.0.0-beta.29 qsl_1193=4.0.0-beta.13 qsl_1194=5.0.0-beta.4 -qsl_120=6.0.3 +qsl_120=7.0.0-alpha.9 fabric_cts8=0.42.0+1.16 fabric_1165=0.42.0+1.16 lfapi=1.9.0