From fc15d1856c8b457067bc6f95d508867e59e87205 Mon Sep 17 00:00:00 2001 From: jackh Date: Sun, 19 Jan 2025 18:31:49 -0700 Subject: [PATCH] t --- .../mixin/impl/entity/MixinEntity.java | 1 - .../keystrokesmod/module/impl/client/Gui.java | 2 +- .../module/impl/combat/KillAura.java | 6 +- .../module/impl/player/Blink.java | 10 ++- .../module/impl/player/NoFall.java | 2 +- .../module/impl/player/Scaffold.java | 40 ++++----- .../module/impl/player/Tower.java | 2 +- .../module/impl/render/Indicators.java | 2 +- .../module/impl/render/ItemESP.java | 2 +- .../utility/command/Command.java | 4 + .../utility/command/impl/Binds.java | 89 +++++++++++-------- 11 files changed, 90 insertions(+), 70 deletions(-) diff --git a/src/main/java/keystrokesmod/mixin/impl/entity/MixinEntity.java b/src/main/java/keystrokesmod/mixin/impl/entity/MixinEntity.java index 2fc21e7..e395662 100644 --- a/src/main/java/keystrokesmod/mixin/impl/entity/MixinEntity.java +++ b/src/main/java/keystrokesmod/mixin/impl/entity/MixinEntity.java @@ -29,7 +29,6 @@ public abstract class MixinEntity { if (entity == mc.thePlayer && entity.onGround) { if (Safewalk.canSafeWalk() || ModuleManager.scaffold.canSafewalk()) { - //Utils.print("Safewalking"); return true; } } diff --git a/src/main/java/keystrokesmod/module/impl/client/Gui.java b/src/main/java/keystrokesmod/module/impl/client/Gui.java index bc1e290..2236fa7 100644 --- a/src/main/java/keystrokesmod/module/impl/client/Gui.java +++ b/src/main/java/keystrokesmod/module/impl/client/Gui.java @@ -17,7 +17,7 @@ public class Gui extends Module { public Gui() { super("Gui", category.client, 54); - this.registerSetting(guiScale = new SliderSetting("Gui scale", 2, new String[]{ "Small", "Normal", "Large" })); + this.registerSetting(guiScale = new SliderSetting("Gui scale", 1, new String[]{ "Small", "Normal", "Large" })); this.registerSetting(backgroundBlur = new SliderSetting("Background blur", "%", 0, 0, 100, 1)); this.registerSetting(scrollSpeed = new SliderSetting("Scroll speed", 50, 2, 90, 1)); this.registerSetting(darkBackground = new ButtonSetting("Dark background", true)); diff --git a/src/main/java/keystrokesmod/module/impl/combat/KillAura.java b/src/main/java/keystrokesmod/module/impl/combat/KillAura.java index b3ce70a..15e3701 100644 --- a/src/main/java/keystrokesmod/module/impl/combat/KillAura.java +++ b/src/main/java/keystrokesmod/module/impl/combat/KillAura.java @@ -401,7 +401,7 @@ public class KillAura extends Module { mc.thePlayer.rotationPitch = smoothedRotations[1]; } } - if (attackingEntity != null && inRange(target, attackRange.getInput())) { + if (target != null && attackingEntity != null && inRange(target, attackRange.getInput())) { isTargeting = true; } else if (isTargeting) { @@ -882,14 +882,14 @@ public class KillAura extends Module { interactTicks++; if (firstCycle) { switch (interactTicks) { - case 2: + case 1: blinking.set(true); if (blocked) { mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN)); blocked = false; } break; - case 3: + case 2: handleInteractAndAttack(distance, true, true, swung); sendBlockPacket(); blocked = true; diff --git a/src/main/java/keystrokesmod/module/impl/player/Blink.java b/src/main/java/keystrokesmod/module/impl/player/Blink.java index 5780fd1..8de38d9 100644 --- a/src/main/java/keystrokesmod/module/impl/player/Blink.java +++ b/src/main/java/keystrokesmod/module/impl/player/Blink.java @@ -5,6 +5,7 @@ import keystrokesmod.event.PreUpdateEvent; import keystrokesmod.event.SendPacketEvent; import keystrokesmod.module.Module; import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.render.HUD; import keystrokesmod.module.setting.impl.ButtonSetting; import keystrokesmod.module.setting.impl.DescriptionSetting; import keystrokesmod.module.setting.impl.SliderSetting; @@ -43,7 +44,7 @@ public class Blink extends Module { private ConcurrentLinkedQueue blinkedPackets = new ConcurrentLinkedQueue<>(); private Vec3 pos; //final private int color = Theme.getGradient((int) theme.getInput(), 255); - final private int color = new Color(0, 187, 255, 255).getRGB(); + private int color = new Color(0, 187, 255, 255).getRGB(); private int blinkTicks; private boolean started; public Blink() { @@ -80,7 +81,7 @@ public class Blink extends Module { this.disable(); return; } - if (ModuleManager.killAura.lag || ModuleManager.killAura.justUnTargeted || ModuleManager.killAura.target != null) { + if (ModuleManager.killAura.isTargeting || ModuleManager.killAura.justUnTargeted) { return; } if (disableOnBreak.isToggled() && (Utils.usingBedAura() || ModuleUtils.isBreaking)) { @@ -119,7 +120,7 @@ public class Blink extends Module { @SubscribeEvent public void onRenderTick(TickEvent.RenderTickEvent ev) { - if (!Utils.nullCheck() || !renderTimer.isToggled()) { + if (!Utils.nullCheck() || !renderTimer.isToggled() || blinkTicks == 0) { return; } if (ev.phase == TickEvent.Phase.END) { @@ -127,13 +128,13 @@ public class Blink extends Module { return; } } + color = Theme.getGradient((int) HUD.theme.getInput(), 0); int widthOffset = (blinkTicks < 10) ? 4 : (blinkTicks >= 10 && blinkTicks < 100) ? 7 : (blinkTicks >= 100 && blinkTicks < 1000) ? 10 : (blinkTicks >= 1000) ? 13 : 16; String text = ("" + blinkTicks); int width = mc.fontRendererObj.getStringWidth(text) + Utils.getBoldWidth(text) / 2; final ScaledResolution scaledResolution = new ScaledResolution(mc); int[] display = {scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), scaledResolution.getScaleFactor()}; mc.fontRendererObj.drawString(text, display[0] / 2 - width + widthOffset, display[1] / 2 + 8, color, true); - //render.text(text, disp[0] / 2 - wid, disp[1] / 2 + 8, 1, -1, true); } @SubscribeEvent @@ -146,6 +147,7 @@ public class Blink extends Module { private void drawBox(Vec3 pos) { GlStateManager.pushMatrix(); + color = Theme.getGradient((int) HUD.theme.getInput(), 0); double x = pos.xCoord - mc.getRenderManager().viewerPosX; double y = pos.yCoord - mc.getRenderManager().viewerPosY; double z = pos.zCoord - mc.getRenderManager().viewerPosZ; diff --git a/src/main/java/keystrokesmod/module/impl/player/NoFall.java b/src/main/java/keystrokesmod/module/impl/player/NoFall.java index ec2ae9f..feb164f 100644 --- a/src/main/java/keystrokesmod/module/impl/player/NoFall.java +++ b/src/main/java/keystrokesmod/module/impl/player/NoFall.java @@ -80,7 +80,7 @@ public class NoFall extends Module { } if (isFalling && mode.getInput() == 3) { if (mc.thePlayer.ticksExisted % 2 == 0) { - Utils.getTimer().timerSpeed = (float) Utils.randomizeDouble(0.5, 0.6); + Utils.getTimer().timerSpeed = (float) Utils.randomizeDouble(0.5, 0.50201); } else { Utils.getTimer().timerSpeed = (float) 1; diff --git a/src/main/java/keystrokesmod/module/impl/player/Scaffold.java b/src/main/java/keystrokesmod/module/impl/player/Scaffold.java index cbefb49..6e350d0 100644 --- a/src/main/java/keystrokesmod/module/impl/player/Scaffold.java +++ b/src/main/java/keystrokesmod/module/impl/player/Scaffold.java @@ -92,6 +92,8 @@ public class Scaffold extends Module { private int disableTicks; private int scaffoldTicks; + private long firstStroke; + public Scaffold() { super("Scaffold", category.player); this.registerSetting(motion = new SliderSetting("Motion", "x", 1.0, 0.5, 1.2, 0.01)); @@ -237,25 +239,22 @@ public class Scaffold extends Module { case 1: e.setRotations(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(), 82); break; - - - - - - - case 2: if (blockRotations != null) { blockYaw = blockRotations[0]; pitch = blockRotations[1]; } else { + firstStroke = System.currentTimeMillis(); blockYaw = 0; - pitch = 82F; + pitch = 80F; + } + if (firstStroke > 0 && (System.currentTimeMillis() - firstStroke) > 250) { + firstStroke = 0; } float side = MathHelper.wrapAngleTo180_float(getMotionYaw() - yaw); - float offset = 137.625F; - float minOffset = (!Utils.scaffoldDiagonal(false)) ? 30 : 0; + float offset = (!Utils.scaffoldDiagonal(false)) ? 125.500F : 140.500F; + float minOffset = (!Utils.scaffoldDiagonal(false)) ? 25 : 0; float yawBackwards = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(); float yawOffset = MathHelper.wrapAngleTo180_float(yawBackwards - blockYaw); @@ -273,13 +272,11 @@ public class Scaffold extends Module { yaw = applyGcd( lastYaw + MathHelper.wrapAngleTo180_float(newYaw - lastYaw) ); - - double minSwitch = (!Utils.scaffoldDiagonal(false)) ? 0 : 13; - if (side >= 0) { + double minSwitch = (!Utils.scaffoldDiagonal(false)) ? 0 : 15; + if (side >= 0 && firstStroke == 0) { if (yawOffset <= -minSwitch) { set2 = false; - } - else if (yawOffset >= 0) { + } else if (yawOffset >= 0) { if (yawOffset >= minSwitch) { set2 = true; } @@ -290,13 +287,12 @@ public class Scaffold extends Module { e.setRotations((yaw + offset * 2) - yawOffset, pitch); break; } - } else if (side <= -0) { + } else if (side <= -0 && firstStroke == 0) { if (yawOffset >= minSwitch) { set2 = false; - } - else if (yawOffset <= 0) { + } else if (yawOffset <= 0) { if (yawOffset <= -minSwitch) { - set2 = true; + set2 = true; } } if (set2) { @@ -315,8 +311,8 @@ public class Scaffold extends Module { if (yawOffset >= minOffset) yawOffset = minOffset; } e.setRotations(yaw - yawOffset, pitch); + set2 = false; break; - case 3: if (blockRotations != null) { e.setRotations(blockRotations[0], blockRotations[1]); @@ -326,8 +322,8 @@ public class Scaffold extends Module { } break; } - - + float yv = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(); + Utils.print("" + MathHelper.wrapAngleTo180_float(yv - e.getYaw())); //jump facing forward if (rotateForward && jumpFacingForward.isToggled()) { diff --git a/src/main/java/keystrokesmod/module/impl/player/Tower.java b/src/main/java/keystrokesmod/module/impl/player/Tower.java index 901a4dc..8ae7c05 100644 --- a/src/main/java/keystrokesmod/module/impl/player/Tower.java +++ b/src/main/java/keystrokesmod/module/impl/player/Tower.java @@ -129,7 +129,7 @@ public class Tower extends Module { else if (setLowMotion) { ++cMotionTicks; if (cMotionTicks == 1) { - mc.thePlayer.motionY = 0.05F; + mc.thePlayer.motionY = 0.06F; } else if (cMotionTicks == 3) { cMotionTicks = 0; diff --git a/src/main/java/keystrokesmod/module/impl/render/Indicators.java b/src/main/java/keystrokesmod/module/impl/render/Indicators.java index 39d4bd3..ea571cc 100644 --- a/src/main/java/keystrokesmod/module/impl/render/Indicators.java +++ b/src/main/java/keystrokesmod/module/impl/render/Indicators.java @@ -269,7 +269,7 @@ public class Indicators extends Module { return new Color(210, 0, 255); } else if (itemStack.getItem() == Items.fire_charge) { - return new Color(255, 150, 0); + return new Color(255, 115, 0); } else { return Color.WHITE; diff --git a/src/main/java/keystrokesmod/module/impl/render/ItemESP.java b/src/main/java/keystrokesmod/module/impl/render/ItemESP.java index 32b2143..da5f658 100644 --- a/src/main/java/keystrokesmod/module/impl/render/ItemESP.java +++ b/src/main/java/keystrokesmod/module/impl/render/ItemESP.java @@ -151,7 +151,7 @@ public class ItemESP extends Module { // entirely skidded from raven b4 source l GlStateManager.pushMatrix(); GlStateManager.translate((float) n4, (float) n5 + 0.3, (float) n6); GlStateManager.rotate(-mc.getRenderManager().playerViewY, 0.0f, 1.0f, 0.0f); - GlStateManager.rotate(mc.getRenderManager().playerViewX, 1.0f, 0.0f, 0.0f); + GlStateManager.rotate((mc.gameSettings.thirdPersonView == 2 ? -1 : 1) * mc.getRenderManager().playerViewX, 1.0f, 0.0f, 0.0f); float min2 = Math.min(Math.max(0.02266667f, (float) (0.001500000013038516 * n7)), 0.07f); GlStateManager.scale(-min2, -min2, -min2); GlStateManager.depthMask(false); diff --git a/src/main/java/keystrokesmod/utility/command/Command.java b/src/main/java/keystrokesmod/utility/command/Command.java index 60c222c..94bd006 100644 --- a/src/main/java/keystrokesmod/utility/command/Command.java +++ b/src/main/java/keystrokesmod/utility/command/Command.java @@ -32,6 +32,10 @@ public abstract class Command { Utils.sendMessage(ModuleManager.lowercaseChatCommands() ? msg.toLowerCase() : msg); } + protected void chatWithPrefix(String msg) { + Utils.sendMessage("&7[&f" + this.command + "&7] &r" + (ModuleManager.lowercaseChatCommands() ? msg.toLowerCase() : msg)); + } + protected void syntaxError() { Utils.sendMessage("§csyntax error"); } diff --git a/src/main/java/keystrokesmod/utility/command/impl/Binds.java b/src/main/java/keystrokesmod/utility/command/impl/Binds.java index 211b193..8e8bb1a 100644 --- a/src/main/java/keystrokesmod/utility/command/impl/Binds.java +++ b/src/main/java/keystrokesmod/utility/command/impl/Binds.java @@ -5,10 +5,11 @@ import keystrokesmod.module.Module; import keystrokesmod.module.ModuleManager; import keystrokesmod.utility.command.Command; import keystrokesmod.utility.profile.Profile; -import org.jetbrains.annotations.NotNull; import org.lwjgl.input.Keyboard; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; public class Binds extends Command { @@ -19,22 +20,34 @@ public class Binds extends Command { @Override public void onExecute(String[] args) { if (args.length <= 1) { - HashMap binds = getBindsModulesMap(0); - chat("&7[&fbinds&7] &b" + binds.size() + " &7module" + (binds.size() == 1 ? "" : "s") + " have keybinds."); - for (Map.Entry bindsMap : binds.entrySet()) { - chat(" &b" + bindsMap.getKey() + " &7" + bindsMap.getValue()); + Map> binds = getBindsModulesMap(0); + int size = getTotalModules(binds); + chatWithPrefix("&b" + size + " &7module" + (size == 1 ? "" : "s") + " have keybinds."); + for (Map.Entry> entry : binds.entrySet()) { + String key = entry.getKey(); + List moduleNames = entry.getValue(); + for (String moduleName : moduleNames) { + chatWithPrefix(" &b" + key + " &7" + moduleName); + } } } else if (args.length == 2) { int keycode = Keyboard.getKeyIndex(args[1].toUpperCase()); if (keycode == 0) { - chat("&7[&fbinds&7] &7Invalid key."); + chatWithPrefix("&7Invalid key."); return; } - HashMap binds = getBindsModulesMap(keycode); - chat("&7[&fbinds&7] &b" + binds.size() + " &7module" + (binds.size() == 1 ? "" : "s") + " has keybind &b" + args[1].toUpperCase() + "&7."); - for (Map.Entry bindsMap : binds.entrySet()) { - chat(" &b" + bindsMap.getKey() + " &7" + bindsMap.getValue()); + + Map> binds = getBindsModulesMap(keycode); + int size = getTotalModules(binds); + chatWithPrefix("&b" + size + " &7module" + (size == 1 ? "" : "s") + " has keybind &b" + args[1].toUpperCase() + "&7."); + + for (Map.Entry> entry : binds.entrySet()) { + String key = entry.getKey(); + List moduleNames = entry.getValue(); + for (String moduleName : moduleNames) { + chatWithPrefix(" &b" + key + " &7" + moduleName); + } } } else { @@ -42,36 +55,42 @@ public class Binds extends Command { } } - private HashMap getBindsModulesMap(int keycode) { - HashMap binds = new HashMap<>(); + private Map> getBindsModulesMap(int keycode) { + Map> binds = new HashMap<>(); for (Module module : ModuleManager.modules) { - if (module.getKeycode() == 0) { - continue; - } - if (keycode != 0 && module.getKeycode() != keycode) { - continue; - } - binds.put((module.getKeycode() >= 1000 ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode())), module.getName()); + addModuleIfMatches(binds, module, keycode); } for (Profile profile : Raven.profileManager.profiles) { Module module = profile.getModule(); - if (module.getKeycode() == 0) { - continue; - } - if (keycode != 0 && module.getKeycode() != keycode) { - continue; - } - binds.put((module.getKeycode() >= 1000 ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode())), module.getName()); + addModuleIfMatches(binds, module, keycode); } - for (Module module : Raven.scriptManager.scripts.values()) { - if (module.getKeycode() == 0) { - continue; - } - if (keycode != 0 && module.getKeycode() != keycode) { - continue; - } - binds.put((module.getKeycode() >= 1000 ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode())), module.getName()); + for (Module scriptModule : Raven.scriptManager.scripts.values()) { + addModuleIfMatches(binds, scriptModule, keycode); } return binds; } -} + + private void addModuleIfMatches(Map> bindsMap, Module module, int keycode) { + if (module.getKeycode() == 0) { + return; + } + if (keycode != 0 && module.getKeycode() != keycode) { + return; + } + String keyName = (module.getKeycode() >= 1000) ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode()); + List moduleNames = bindsMap.get(keyName); + if (moduleNames == null) { + moduleNames = new ArrayList<>(); + bindsMap.put(keyName, moduleNames); + } + moduleNames.add(module.getName()); + } + + private int getTotalModules(Map> binds) { + int total = 0; + for (List modules : binds.values()) { + total += modules.size(); + } + return total; + } +} \ No newline at end of file