diff --git a/src/main/java/dev/stardust/modules/AutoDrawDistance.java b/src/main/java/dev/stardust/modules/AutoDrawDistance.java index 935c392..f123b2f 100644 --- a/src/main/java/dev/stardust/modules/AutoDrawDistance.java +++ b/src/main/java/dev/stardust/modules/AutoDrawDistance.java @@ -14,6 +14,7 @@ import meteordevelopment.meteorclient.settings.BoolSetting; import meteordevelopment.meteorclient.events.world.TickEvent; import meteordevelopment.meteorclient.systems.modules.Module; +import meteordevelopment.meteorclient.mixininterface.IChatHud; /** @@ -105,10 +106,9 @@ private void updateDrawDistance(int distance) { mc.options.sendClientSettings(); if (verbose.get() && !(mc.player == null)) { - mc.player.sendMessage( - Text.of( - "§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Updated view distance to§8: §2"+distance+"§7." - ) + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( + Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Updated view distance to§8: §2"+distance+"§7."), + "View distance debug update".hashCode() ); } } @@ -162,16 +162,16 @@ private void onTick(TickEvent.Post event) { sweetSpotCounter = 0; if (verbose.get() && mc.player != null) { if (reportFPS.get()) { - mc.player.sendMessage( - Text.of( - "§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Average FPS§8: §2"+averageFps - )); + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( + Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Average FPS§8: §2"+averageFps), + "Average FPS update".hashCode() + ); } - mc.player.sendMessage( - Text.of( - "§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Entered a §2sweet spot§8!" - )); + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( + Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Entered a §2sweet spot§8!"), + "Sweet spot update".hashCode() + ); } } else { justIncreased++; @@ -187,10 +187,10 @@ private void onTick(TickEvent.Post event) { justIncreased++; fpsData.clear(); if (verbose.get() && reportFPS.get() && mc.player != null) { - mc.player.sendMessage( - Text.of( - "§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Average FPS§8: §2"+averageFps - )); + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( + Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Average FPS§8: §2"+averageFps), + "Average FPS update".hashCode() + ); } updateDrawDistance(drawDistance + 1); @@ -200,10 +200,10 @@ private void onTick(TickEvent.Post event) { if (drawDistance <= minDistance.get()) return; if (verbose.get() && reportFPS.get() && mc.player != null) { - mc.player.sendMessage( - Text.of( - "§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Average FPS§8: §2"+averageFps - )); + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( + Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Average FPS§8: §2"+averageFps), + "Average FPS update".hashCode() + ); } fpsData.clear(); diff --git a/src/main/java/dev/stardust/modules/BannerData.java b/src/main/java/dev/stardust/modules/BannerData.java index 6532fa1..59a1b61 100644 --- a/src/main/java/dev/stardust/modules/BannerData.java +++ b/src/main/java/dev/stardust/modules/BannerData.java @@ -3,6 +3,7 @@ import java.util.List; import java.util.Optional; import dev.stardust.Stardust; +import meteordevelopment.meteorclient.mixininterface.IChatHud; import net.minecraft.text.Text; import net.minecraft.util.DyeColor; import net.minecraft.block.entity.*; @@ -174,11 +175,12 @@ private void onRightClickBlock(InteractBlockEvent event) { if (copyToClipboard.get()) { NbtCompound metadata = banner.toInitialChunkDataNbt(); mc.keyboard.setClipboard(metadata.toString()); - mc.player.sendMessage( + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( Text.of( "§8<"+StardustUtil.rCC()+"§o✨§r§8> §7" - + txtFormat + "Copied NBT data to clipboard§7." - ) + + txtFormat + "Copied NBT data to clipboard§7." + ), + "Clipboard update".hashCode() ); } @@ -187,11 +189,12 @@ private void onRightClickBlock(InteractBlockEvent event) { NbtCompound metadata = sign.toInitialChunkDataNbt(); if (copyToClipboard.get()) { mc.keyboard.setClipboard(metadata.toString()); - mc.player.sendMessage( + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( Text.of( "§8<"+StardustUtil.rCC()+"§o✨§r§8> §7§o" + "Copied NBT data to clipboard." - ) + ), + "Clipboard update".hashCode() ); } else { mc.player.sendMessage( diff --git a/src/main/java/dev/stardust/modules/RocketMan.java b/src/main/java/dev/stardust/modules/RocketMan.java index b41348c..d55cc13 100644 --- a/src/main/java/dev/stardust/modules/RocketMan.java +++ b/src/main/java/dev/stardust/modules/RocketMan.java @@ -16,6 +16,7 @@ import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.events.world.TickEvent; import meteordevelopment.meteorclient.systems.modules.Modules; +import meteordevelopment.meteorclient.mixininterface.IChatHud; import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket; import meteordevelopment.meteorclient.events.packets.PacketEvent; import meteordevelopment.meteorclient.systems.modules.render.FreeLook; @@ -327,8 +328,9 @@ private void handleDurabilityChecks() { float vol = warnVolume.get() / 100f; mc.player.playSound(SoundEvents.ENTITY_ITEM_BREAK, vol, 1f); } - mc.player.sendMessage( - Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Elytra durability: §4"+percentDurability+"§7%") + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( + Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Elytra durability: §4"+percentDurability+"§7%"), + "Elytra durability warning".hashCode() ); ticksSinceWarned = 0; } @@ -341,8 +343,9 @@ private void handleDurabilityChecks() { float vol = warnVolume.get() / 100f; mc.player.playSound(SoundEvents.ENTITY_ITEM_BREAK, vol, 1f); } - mc.player.sendMessage( - Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Elytra durability: §c"+percentDurability+"§7%") + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( + Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Elytra durability: §4"+percentDurability+"§7%"), + "Elytra durability warning".hashCode() ); ticksSinceWarned = 0; } @@ -366,8 +369,9 @@ private void handleFireworkRocketChecks() { float vol = notifyVolume.get() / 100f; mc.player.playSound(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, vol, 1f); } - mc.player.sendMessage( - Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Rockets remaining: §c"+totalRockets+"§7.") + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( + Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> §7Rockets remaining: §c"+totalRockets+"§7."), + "Rockets remaining warning".hashCode() ); ticksSinceNotified = 0; } @@ -435,12 +439,16 @@ public void onActivate() { } } if (!foundElytra) { - this.toggle(); - mc.player.sendMessage(Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> "+"§4No elytra in inventory!")); + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( + Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> "+"§4No elytra in inventory!"), + "No elytra warning".hashCode() + ); } } else { - this.toggle(); - mc.player.sendMessage(Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> "+"§4No elytra equipped!")); + ((IChatHud) mc.inGameHud.getChatHud()).meteor$add( + Text.of("§8<"+ StardustUtil.rCC()+"§o✨§r§8> "+"§4No elytra equipped!"), + "No elytra warning".hashCode() + ); } } else if (takeoff.get() && mc.player.isFallFlying()) { useFireworkRocket();