diff --git a/src/main/java/keystrokesmod/clickgui/components/impl/BindComponent.java b/src/main/java/keystrokesmod/clickgui/components/impl/BindComponent.java index 6575deb5e..d59015a01 100644 --- a/src/main/java/keystrokesmod/clickgui/components/impl/BindComponent.java +++ b/src/main/java/keystrokesmod/clickgui/components/impl/BindComponent.java @@ -96,7 +96,7 @@ public int gh() { } private void drawString(String s) { - getFont().drawStringWithShadow(s, (float) ((this.parent.categoryComponent.getX() + 4) * 2), (float) ((this.parent.categoryComponent.getY() + this.bind + 3) * 2), !this.parent.mod.hidden ? Theme.getGradient(10, 0) : Theme.getGradient(11, 0)); + getFont().drawStringWithShadow(s, (float) ((this.parent.categoryComponent.getX() + 4) * 2), (float) ((this.parent.categoryComponent.getY() + this.bind + 3) * 2), Gui.getColor()); } public void onGuiClosed() { diff --git a/src/main/java/keystrokesmod/clickgui/components/impl/DescriptionComponent.java b/src/main/java/keystrokesmod/clickgui/components/impl/DescriptionComponent.java index 1608ca975..4059de972 100644 --- a/src/main/java/keystrokesmod/clickgui/components/impl/DescriptionComponent.java +++ b/src/main/java/keystrokesmod/clickgui/components/impl/DescriptionComponent.java @@ -1,6 +1,7 @@ package keystrokesmod.clickgui.components.impl; import keystrokesmod.clickgui.components.Component; +import keystrokesmod.module.impl.client.Gui; import keystrokesmod.module.setting.Setting; import keystrokesmod.module.setting.impl.DescriptionSetting; import keystrokesmod.utility.Theme; @@ -28,7 +29,7 @@ public DescriptionComponent(DescriptionSetting desc, ModuleComponent b, int o) { public void render() { GL11.glPushMatrix(); GL11.glScaled(0.5D, 0.5D, 0.5D); - getFont().drawString(this.desc.getPrettyDesc(), (float) ((this.parent.categoryComponent.getX() + 4) * 2), (float) ((this.parent.categoryComponent.getY() + this.o + 4) * 2), Theme.getGradient(10, 0), true); + getFont().drawString(this.desc.getPrettyDesc(), (float) ((this.parent.categoryComponent.getX() + 4) * 2), (float) ((this.parent.categoryComponent.getY() + this.o + 4) * 2), Gui.getColor(), true); GL11.glPopMatrix(); } diff --git a/src/main/java/keystrokesmod/clickgui/components/impl/SliderComponent.java b/src/main/java/keystrokesmod/clickgui/components/impl/SliderComponent.java index d9841f997..0f092142c 100644 --- a/src/main/java/keystrokesmod/clickgui/components/impl/SliderComponent.java +++ b/src/main/java/keystrokesmod/clickgui/components/impl/SliderComponent.java @@ -3,6 +3,7 @@ import keystrokesmod.Raven; import keystrokesmod.clickgui.components.Component; import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.client.Gui; import keystrokesmod.module.setting.Setting; import keystrokesmod.module.setting.impl.SliderSetting; import keystrokesmod.utility.Utils; @@ -43,7 +44,7 @@ public void render() { r = l + 84; } - RenderUtils.drawRoundedRectangle(l, this.parent.categoryComponent.getY() + this.o + 11, r, this.parent.categoryComponent.getY() + this.o + 15, 3, Color.getHSBColor((float) (System.currentTimeMillis() % 11000L) / 11000.0F, 0.75F, 0.9F).getRGB()); + RenderUtils.drawRoundedRectangle(l, this.parent.categoryComponent.getY() + this.o + 11, r, this.parent.categoryComponent.getY() + this.o + 15, 3, Gui.getColor()); GL11.glPushMatrix(); GL11.glScaled(0.5D, 0.5D, 0.5D); String value; diff --git a/src/main/java/keystrokesmod/module/impl/client/Gui.java b/src/main/java/keystrokesmod/module/impl/client/Gui.java index 42ca99db6..e523a9601 100644 --- a/src/main/java/keystrokesmod/module/impl/client/Gui.java +++ b/src/main/java/keystrokesmod/module/impl/client/Gui.java @@ -5,11 +5,13 @@ import keystrokesmod.module.Module; import keystrokesmod.module.setting.impl.ButtonSetting; import keystrokesmod.module.setting.impl.ModeSetting; +import keystrokesmod.utility.Theme; import keystrokesmod.utility.Utils; public class Gui extends Module { public static ButtonSetting removePlayerModel, resetPosition, translucentBackground, removeWatermark, rainBowOutlines, toolTip; public static ModeSetting font; + public static ModeSetting theme; public Gui() { super("Gui", Module.category.client, 54); @@ -20,6 +22,11 @@ public Gui() { this.registerSetting(toolTip = new ButtonSetting("Tool tip", true)); this.registerSetting(resetPosition = new ButtonSetting("Reset position", ClickGui::resetPosition)); this.registerSetting(font = new ModeSetting("Font", new String[]{"Minecraft", "Product Sans", "Tenacity"}, 0)); + this.registerSetting(theme = new ModeSetting("Theme", Theme.themes, 0)); + } + + public static int getColor() { + return Theme.getGradient((int) theme.getInput(), 12); } public void onEnable() { diff --git a/src/main/java/keystrokesmod/module/impl/combat/AutoGapple.java b/src/main/java/keystrokesmod/module/impl/combat/AutoGapple.java index 22d0a4ed3..fc3b62bf5 100644 --- a/src/main/java/keystrokesmod/module/impl/combat/AutoGapple.java +++ b/src/main/java/keystrokesmod/module/impl/combat/AutoGapple.java @@ -1,146 +1,140 @@ package keystrokesmod.module.impl.combat; +import keystrokesmod.event.PreMotionEvent; import keystrokesmod.event.PreMoveEvent; import keystrokesmod.event.PreUpdateEvent; -import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.event.PreVelocityEvent; import keystrokesmod.module.Module; import keystrokesmod.module.impl.other.SlotHandler; -import keystrokesmod.module.impl.player.Blink; import keystrokesmod.module.setting.impl.ButtonSetting; import keystrokesmod.module.setting.impl.SliderSetting; -import keystrokesmod.script.classes.Vec3; import keystrokesmod.utility.PacketUtils; import keystrokesmod.utility.Utils; import keystrokesmod.utility.render.Animation; import keystrokesmod.utility.render.Easing; import keystrokesmod.utility.render.progress.Progress; import keystrokesmod.utility.render.progress.ProgressManager; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.network.Packet; import net.minecraft.network.play.client.C03PacketPlayer; -import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; -import net.minecraft.network.play.client.C09PacketHeldItemChange; -import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; -import java.util.HashMap; -import java.util.Queue; -import java.util.concurrent.ConcurrentLinkedQueue; - public class AutoGapple extends Module { - public final ButtonSetting disableKillAura; private final SliderSetting minHealth; - private final SliderSetting delayBetweenHeal; - private final ButtonSetting airStuck; - private final ButtonSetting blink; + private final SliderSetting eatTicks; + private final SliderSetting pauseOnVelocity; + private final SliderSetting storeDelay; + private final SliderSetting storePauseTicks; private final ButtonSetting visual; private final ButtonSetting onlyWhileKillAura; - private final Queue> delayedSend = new ConcurrentLinkedQueue<>(); - private final HashMap realPositions = new HashMap<>(); + private final Animation animation = new Animation(Easing.EASE_OUT_CIRC, 500); private final Progress progress = new Progress("AutoGapple"); public boolean working = false; - private int eatingTicksLeft = 0; - private int releaseLeft = 0; - private int foodSlot; + private int stored = 0; + private int pauseTicks = 0; + private boolean storeDelayed = false; + private boolean toCancel = false; public AutoGapple() { super("AutoGapple", category.combat, "Made for QuickMacro."); this.registerSetting(minHealth = new SliderSetting("Min health", 10, 1, 20, 1)); - this.registerSetting(delayBetweenHeal = new SliderSetting("Delay between heal", 5, 0, 40, 1)); - this.registerSetting(disableKillAura = new ButtonSetting("Disable killAura", false)); - this.registerSetting(airStuck = new ButtonSetting("Air stuck", false)); - this.registerSetting(blink = new ButtonSetting("Blink", false)); + this.registerSetting(eatTicks = new SliderSetting("Eat ticks", 31, 31, 35, 1)); + this.registerSetting(pauseOnVelocity = new SliderSetting("Pause on velocity", 1, 0, 2, 1)); + this.registerSetting(storeDelay = new SliderSetting("Store delay", 5, 0, 10, 1)); + this.registerSetting(storePauseTicks = new SliderSetting("Store pause ticks", 1, 1, 3, 1, () -> storeDelay.getInput() > 0)); this.registerSetting(visual = new ButtonSetting("Visual", true)); this.registerSetting(onlyWhileKillAura = new ButtonSetting("Only while killAura", true)); } @Override public void onDisable() { - working = false; - eatingTicksLeft = 0; - releaseLeft = 0; - release(); - realPositions.clear(); + reset(); ProgressManager.remove(progress); } + public void reset() { + working = false; + stored = 0; + pauseTicks = 0; + storeDelayed = false; + toCancel = false; + progress.setProgress(0); + } + @SubscribeEvent public void onPreUpdate(PreUpdateEvent event) { - if (eatingTicksLeft == 0 && working) { + if (!Utils.nullCheck() + || mc.thePlayer.isDead + || mc.thePlayer.getHealth() >= minHealth.getInput() + || (onlyWhileKillAura.isToggled() && KillAura.target == null)) { working = false; - int lastSlot = SlotHandler.getCurrentSlot(); - if (foodSlot != lastSlot) - PacketUtils.sendPacketNoEvent(new C09PacketHeldItemChange(foodSlot)); - PacketUtils.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(mc.thePlayer.inventory.mainInventory[foodSlot])); - Utils.sendMessage("send."); - release(); - if (foodSlot != lastSlot) - PacketUtils.sendPacketNoEvent(new C09PacketHeldItemChange(lastSlot)); - releaseLeft = (int) delayBetweenHeal.getInput(); - foodSlot = -1; + return; } - if (releaseLeft > 0) { - releaseLeft--; - } + if (stored >= eatTicks.getInput() && working) { + reset(); - if (!Utils.nullCheck() || mc.thePlayer.getHealth() >= minHealth.getInput() || (onlyWhileKillAura.isToggled() && KillAura.target == null)) { - eatingTicksLeft = 0; - return; + int foodSlot = getFoodSlot(); + int curSlot = SlotHandler.getCurrentSlot(); + if (foodSlot != curSlot) { + SlotHandler.setCurrentSlot(foodSlot); + } + mc.playerController.sendUseItem(mc.thePlayer, mc.theWorld, SlotHandler.getHeldItem()); + PacketUtils.sendPacket(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.DROP_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)); + Utils.sendMessage("send."); + for (int i = 0; i < stored; i++) { + PacketUtils.sendPacket(new C03PacketPlayer(mc.thePlayer.onGround)); + } + if (foodSlot != curSlot) { + SlotHandler.setCurrentSlot(curSlot); + } } - if (eatingTicksLeft > 0) { + if (getFoodSlot() != -1) { working = true; - eatingTicksLeft--; - - return; + } else { + reset(); } + } - if (releaseLeft > 0) - return; - - foodSlot = eat(); - if (foodSlot != -1) { - animation.reset(); - eatingTicksLeft = 35; - animation.setValue(eatingTicksLeft); - mc.theWorld.playerEntities.parallelStream() - .filter(p -> p != mc.thePlayer) - .forEach(p -> realPositions.put(p.getEntityId(), new RealPositionData(p))); - } + @SubscribeEvent + public void onPreVelocity(PreVelocityEvent event) { + pauseTicks += (int) pauseOnVelocity.getInput(); } - @SubscribeEvent(priority = EventPriority.HIGH) - public void onSendPacket(SendPacketEvent event) { - if (working) { - delayedSend.add(event.getPacket()); - event.setCanceled(true); + @SubscribeEvent + public void onPreMove(PreMoveEvent event) { + if (!working) return; + + if (!storeDelayed && stored % (int) storeDelay.getInput() == 1) { + storeDelayed = true; + pauseTicks = (int) storePauseTicks.getInput(); } - } - private void release() { - synchronized (delayedSend) { - for (Packet p : delayedSend) { - PacketUtils.sendPacket(p); - } - delayedSend.clear(); + if (pauseTicks > 0) { + pauseTicks--; + } else { + event.setCanceled(true); + stored++; + storeDelayed = false; + toCancel = true; } } - @SubscribeEvent - public void onMove(PreMoveEvent event) { - if (working && releaseLeft == 0 && airStuck.isToggled()) { + @SubscribeEvent(priority = EventPriority.HIGH) + public void onPreMotion(PreMotionEvent event) { + if (toCancel) event.setCanceled(true); - delayedSend.add(new C03PacketPlayer(mc.thePlayer.onGround)); - } + toCancel = false; } - private int eat() { + public int getFoodSlot() { int slot = -1; for (int i = 0; i < 9; ++i) { final ItemStack getStackInSlot = mc.thePlayer.inventory.getStackInSlot(i); @@ -153,48 +147,13 @@ private int eat() { } @SubscribeEvent - public void onRender2D(TickEvent.RenderTickEvent event) { - if (!Utils.nullCheck() || mc.thePlayer.isDead) { - working = false; - eatingTicksLeft = 0; - release(); - releaseLeft = (int) delayBetweenHeal.getInput(); - foodSlot = -1; - } - - animation.run(eatingTicksLeft); + public void onRenderTick(TickEvent.RenderTickEvent event) { + animation.run(eatTicks.getInput() - stored); if (working && visual.isToggled()) { - progress.setProgress((32 - animation.getValue()) / 32); + progress.setProgress((eatTicks.getInput() - animation.getValue()) / eatTicks.getInput()); ProgressManager.add(progress); } else { ProgressManager.remove(progress); } } - - @SubscribeEvent - public void onRender(RenderWorldLastEvent e) { - if (eatingTicksLeft == 0) - return; - - for (RealPositionData data : realPositions.values()) { - data.animationX.run(data.vec3.x()); - data.animationY.run(data.vec3.y()); - data.animationZ.run(data.vec3.z()); - Blink.drawBox(new net.minecraft.util.Vec3(data.animationX.getValue(), data.animationY.getValue(), data.animationZ.getValue())); - } - } - - private static class RealPositionData { - public Vec3 vec3; - public Animation animationX = new Animation(Easing.EASE_OUT_CIRC, 150); - public Animation animationY = new Animation(Easing.EASE_OUT_CIRC, 150); - public Animation animationZ = new Animation(Easing.EASE_OUT_CIRC, 150); - - public RealPositionData(EntityPlayer player) { - vec3 = new Vec3(player); - animationX.setValue(vec3.x()); - animationY.setValue(vec3.y()); - animationZ.setValue(vec3.z()); - } - } } diff --git a/src/main/java/keystrokesmod/module/impl/combat/KillAura.java b/src/main/java/keystrokesmod/module/impl/combat/KillAura.java index d596deeab..fc41806d2 100644 --- a/src/main/java/keystrokesmod/module/impl/combat/KillAura.java +++ b/src/main/java/keystrokesmod/module/impl/combat/KillAura.java @@ -323,10 +323,6 @@ public void onPreUpdate(PreUpdateEvent event) { resetBlinkState(true); return; } - if (ModuleManager.autoGapple != null && ModuleManager.autoGapple.disableKillAura.isToggled() && ModuleManager.autoGapple.working) { - resetBlinkState(true); - return; - } if ((mc.thePlayer.isBlocking() || block.get()) && disableWhileBlocking.isToggled()) { resetBlinkState(true); diff --git a/src/main/java/keystrokesmod/module/impl/movement/Speed.java b/src/main/java/keystrokesmod/module/impl/movement/Speed.java index 9d06da43a..8cb151b37 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/Speed.java +++ b/src/main/java/keystrokesmod/module/impl/movement/Speed.java @@ -26,7 +26,6 @@ public Speed() { .add(new BlocksMCSpeed("BlocksMC", this)) .add(new VulcanSpeed("Vulcan", this)) .add(new GrimACSpeed("GrimAC", this)) - .add(new IntaveSpeed("Intave", this)) .add(new StrafeSpeed("Strafe", this)) ); this.registerSetting(liquidDisable = new ButtonSetting("Disable in liquid", true)); diff --git a/src/main/java/keystrokesmod/module/impl/movement/Sprint.java b/src/main/java/keystrokesmod/module/impl/movement/Sprint.java index 83b40029b..2d5554859 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/Sprint.java +++ b/src/main/java/keystrokesmod/module/impl/movement/Sprint.java @@ -31,8 +31,8 @@ public Sprint() { public static boolean omni() { final SprintEvent event = new SprintEvent( - MoveUtil.isMoving(), - omni || ModuleManager.sprint != null && ModuleManager.sprint.isEnabled() && ModuleManager.sprint.mode.getInput() == 1 + MoveUtil.canSprint(true), + omni || (ModuleManager.sprint != null && ModuleManager.sprint.isEnabled() && ModuleManager.sprint.mode.getInput() == 1) ); return event.isSprint() && event.isOmni(); @@ -48,10 +48,9 @@ public static boolean stopSprint() { public void p(PlayerTickEvent e) { if (Utils.nullCheck() && mc.inGameHasFocus) { - if(ModuleManager.scaffold.isEnabled() && disableWhileScaffold.isToggled()) { + if (ModuleManager.scaffold.isEnabled() && disableWhileScaffold.isToggled()) { KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), false); - } - else { + } else { KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), true); } diff --git a/src/main/java/keystrokesmod/module/impl/movement/noslow/GrimACNoSlow.java b/src/main/java/keystrokesmod/module/impl/movement/noslow/GrimACNoSlow.java index d99e544cf..da1912dd7 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/noslow/GrimACNoSlow.java +++ b/src/main/java/keystrokesmod/module/impl/movement/noslow/GrimACNoSlow.java @@ -1,20 +1,26 @@ package keystrokesmod.module.impl.movement.noslow; +import keystrokesmod.event.PreUpdateEvent; import keystrokesmod.event.SendPacketEvent; import keystrokesmod.module.impl.movement.NoSlow; import keystrokesmod.module.impl.other.SlotHandler; import keystrokesmod.utility.PacketUtils; import keystrokesmod.utility.Utils; +import net.minecraft.item.ItemBow; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; import net.minecraft.network.play.client.C07PacketPlayerDigging; import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.jetbrains.annotations.NotNull; public class GrimACNoSlow extends INoSlow { + private boolean toCancel = false; + public GrimACNoSlow(String name, @NotNull NoSlow parent) { super(name, parent); } @@ -23,15 +29,39 @@ public GrimACNoSlow(String name, @NotNull NoSlow parent) { public void onSendPacket(@NotNull SendPacketEvent event) { if (canFoodNoSlow()) { if (event.getPacket() instanceof C08PacketPlayerBlockPlacement) { + event.setCanceled(true); + PacketUtils.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(SlotHandler.getHeldItem())); PacketUtils.sendPacketNoEvent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.DROP_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)); Utils.sendClick(1, false); - } else if (event.getPacket() instanceof C07PacketPlayerDigging) { - if (((C07PacketPlayerDigging) event.getPacket()).getStatus() == C07PacketPlayerDigging.Action.RELEASE_USE_ITEM) + toCancel = true; + } else if (toCancel && event.getPacket() instanceof C07PacketPlayerDigging) { + if (((C07PacketPlayerDigging) event.getPacket()).getStatus() == C07PacketPlayerDigging.Action.RELEASE_USE_ITEM) { + toCancel = false; event.setCanceled(true); + } } } } + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent event) { + ItemStack itemStack = SlotHandler.getHeldItem(); + if (!mc.thePlayer.isUsingItem() || itemStack == null) { + toCancel = false; + return; + } + + if (NoSlow.bow.isToggled() && itemStack.getItem() instanceof ItemBow) { + PacketUtils.sendPacket(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem % 8 + 1)); + PacketUtils.sendPacket(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem % 7 + 2)); + PacketUtils.sendPacket(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem)); + } else if (NoSlow.sword.isToggled() && itemStack.getItem() instanceof ItemSword) { + PacketUtils.sendPacket(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem % 8 + 1)); + PacketUtils.sendPacket(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem % 7 + 2)); + PacketUtils.sendPacket(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem)); + } + } + private boolean canFoodNoSlow() { final ItemStack item = SlotHandler.getHeldItem(); return item != null && item.getItem() instanceof ItemFood && item.stackSize > 2; @@ -42,4 +72,9 @@ public float getSlowdown() { ItemStack item = SlotHandler.getHeldItem(); return item != null && item.getItem() instanceof ItemFood ? .2f : 1; } + + @Override + public void onDisable() throws Throwable { + toCancel = false; + } } diff --git a/src/main/java/keystrokesmod/module/impl/movement/noslow/HypixelNoSlow.java b/src/main/java/keystrokesmod/module/impl/movement/noslow/HypixelNoSlow.java index afd971c7b..cd13d1e51 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/noslow/HypixelNoSlow.java +++ b/src/main/java/keystrokesmod/module/impl/movement/noslow/HypixelNoSlow.java @@ -74,9 +74,6 @@ public void onSendPacket(@NotNull SendPacketEvent event) { @Override public float getSlowdown() { - ItemStack item = SlotHandler.getHeldItem(); - if (item != null && item.getItem() instanceof ItemSword) - return 0.8f; return 1; } } diff --git a/src/main/java/keystrokesmod/module/impl/movement/speed/HypixelSpeed.java b/src/main/java/keystrokesmod/module/impl/movement/speed/HypixelSpeed.java index acf390232..c14504b1b 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/speed/HypixelSpeed.java +++ b/src/main/java/keystrokesmod/module/impl/movement/speed/HypixelSpeed.java @@ -18,6 +18,7 @@ public class HypixelSpeed extends SubMode { private final ModeValue mode; private final ButtonSetting strafe; + private final SliderSetting slowdown; private final SliderSetting minAngle; private final ButtonSetting fullStrafe; @@ -31,6 +32,7 @@ public HypixelSpeed(String name, @NotNull Speed parent) { .add(new HypixelLowHopSpeed("LowHop", this)) ); this.registerSetting(strafe = new ButtonSetting("Strafe", false)); + this.registerSetting(slowdown = new SliderSetting("Slowdown", 1, 1, 2, 0.01, strafe::isToggled)); this.registerSetting(minAngle = new SliderSetting("Min angle", 30, 15, 90, 15, strafe::isToggled)); this.registerSetting(fullStrafe = new ButtonSetting("Full strafe", false, strafe::isToggled)); } @@ -39,16 +41,16 @@ public HypixelSpeed(String name, @NotNull Speed parent) { public void onPreUpdate(PreUpdateEvent event) { if (strafe.isToggled() && canStrafe()) { if (parent.offGroundTicks == 9) { - MoveUtil.strafe(0.2); + MoveUtil.strafe(Math.min(0.2 * slowdown.getInput(), MoveUtil.speed())); mc.thePlayer.motionY += 0.1; } else { - MoveUtil.strafe(0.11); + MoveUtil.strafe(Math.min(0.11 * slowdown.getInput(), MoveUtil.speed())); } } } private boolean canStrafe() { - if (mc.thePlayer.onGround) + if (mc.thePlayer.onGround || !MoveUtil.isMoving()) return false; final double curAngle = Move.fromMovement(mc.thePlayer.moveForward, mc.thePlayer.moveStrafing).getDeltaYaw() + TargetStrafe.getMovementYaw(); @@ -58,8 +60,8 @@ private boolean canStrafe() { lastAngle = curAngle; if (fullStrafe.isToggled()) - return parent.offGroundTicks >= 4 && parent.offGroundTicks <= 9; - return parent.offGroundTicks == 4 || parent.offGroundTicks == 9; + return parent.offGroundTicks == 1 || (parent.offGroundTicks >= 4 && parent.offGroundTicks <= 9); + return parent.offGroundTicks == 1 || parent.offGroundTicks == 4 || parent.offGroundTicks == 9; } @Override diff --git a/src/main/java/keystrokesmod/module/impl/movement/speed/IntaveSpeed.java b/src/main/java/keystrokesmod/module/impl/movement/speed/IntaveSpeed.java deleted file mode 100644 index dc852aa5e..000000000 --- a/src/main/java/keystrokesmod/module/impl/movement/speed/IntaveSpeed.java +++ /dev/null @@ -1,39 +0,0 @@ -package keystrokesmod.module.impl.movement.speed; - -import keystrokesmod.module.impl.movement.Speed; -import keystrokesmod.module.setting.impl.ButtonSetting; -import keystrokesmod.module.setting.impl.SubMode; -import keystrokesmod.utility.MoveUtil; -import keystrokesmod.utility.Utils; -import org.jetbrains.annotations.NotNull; - -/** - * @see net.ccbluex.liquidbounce.features.module.modules.movement.speedmodes.other.MineblazeHop - *

- * credit: @thatonecoder & @larryngton / Intave14 - */ -public class IntaveSpeed extends SubMode { - private final ButtonSetting airSpeed; - - public IntaveSpeed(String name, @NotNull Speed parent) { - super(name, parent); - this.registerSetting(airSpeed = new ButtonSetting("Air speed", true)); - } - - @Override - public void onUpdate() { - if (!MoveUtil.isMoving() || Utils.inLiquid() || mc.thePlayer.isOnLadder() || Utils.jumpDown()) return; - - if (mc.thePlayer.onGround) { - mc.thePlayer.jump(); - - if (mc.thePlayer.isSprinting()) - MoveUtil.strafe(0.29); - } - - if (mc.thePlayer.motionY > 0.003 && mc.thePlayer.isSprinting() && airSpeed.isToggled()) { - mc.thePlayer.motionX *= 1.0015; - mc.thePlayer.motionZ *= 1.0015; - } - } -} diff --git a/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/HypixelGroundSpeed.java b/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/HypixelGroundSpeed.java index 1524682fe..d6c1e0f2a 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/HypixelGroundSpeed.java +++ b/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/HypixelGroundSpeed.java @@ -1,23 +1,48 @@ package keystrokesmod.module.impl.movement.speed.hypixel; -import keystrokesmod.event.PrePlayerInputEvent; +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.event.SendPacketEvent; import keystrokesmod.module.impl.movement.speed.HypixelSpeed; +import keystrokesmod.module.impl.player.blink.NormalBlink; import keystrokesmod.module.setting.impl.SubMode; import keystrokesmod.utility.MoveUtil; -import keystrokesmod.utility.Utils; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.jetbrains.annotations.NotNull; public class HypixelGroundSpeed extends SubMode { + private final NormalBlink blink = new NormalBlink("Blink", this) { + @Override + public void onSendPacket(@NotNull SendPacketEvent e) { + if (e.getPacket() instanceof C0FPacketConfirmTransaction) + return; + super.onSendPacket(e); + } + }; + public HypixelGroundSpeed(String name, @NotNull HypixelSpeed parent) { super(name, parent); } - @SubscribeEvent - public void onPrePlayerInput(PrePlayerInputEvent event) { - if (!Utils.nullCheck() || parent.parent.noAction()) return; - if (mc.thePlayer.onGround && MoveUtil.isMoving() && mc.currentScreen == null) { - event.setSpeed(MoveUtil.getAllowedHorizontalDistance() - Math.random() / 100); + public void onDisable() { + blink.disable(); + + mc.thePlayer.motionX *= .8; + mc.thePlayer.motionZ *= .8; + } + + @SubscribeEvent(priority = EventPriority.HIGH) + public void onPreUpdate(PreMotionEvent event) { + if (mc.thePlayer.onGround) { + mc.thePlayer.motionX *= 1.114 - MoveUtil.getSpeedEffect() * .01 - Math.random() * 1E-4; + mc.thePlayer.motionZ *= 1.114 - MoveUtil.getSpeedEffect() * .01 - Math.random() * 1E-4; + } + + if (mc.thePlayer.onGround && mc.thePlayer.ticksExisted % 2 == 0) { + blink.enable(); + } else { + blink.disable(); } } } diff --git a/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/HypixelLowHopSpeed.java b/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/HypixelLowHopSpeed.java index 6e0f9206b..9739336e9 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/HypixelLowHopSpeed.java +++ b/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/HypixelLowHopSpeed.java @@ -1,7 +1,9 @@ package keystrokesmod.module.impl.movement.speed.hypixel; +import keystrokesmod.module.ModuleManager; import keystrokesmod.module.impl.exploit.disabler.hypixel.HypixelMotionDisabler; import keystrokesmod.module.impl.movement.speed.HypixelSpeed; +import keystrokesmod.module.impl.movement.speed.hypixel.lowhop.HypixelLowHopMotionSpeed; import keystrokesmod.module.impl.movement.speed.hypixel.lowhop.HypixelLowHopPredictSpeed; import keystrokesmod.module.setting.impl.ButtonSetting; import keystrokesmod.module.setting.impl.DescriptionSetting; @@ -21,6 +23,7 @@ public HypixelLowHopSpeed(String name, @NotNull HypixelSpeed parent) { this.registerSetting(new DescriptionSetting("Motion disabler only.")); this.registerSetting(mode = new ModeValue("Mode", this) .add(new HypixelLowHopPredictSpeed("Predict", this)) + .add(new HypixelLowHopMotionSpeed("7 Tick", this)) ); this.registerSetting(stopOnHurt = new ButtonSetting("Stop on hurt", true)); } @@ -37,6 +40,7 @@ public void onDisable() throws Throwable { public boolean noLowHop() { if (!HypixelMotionDisabler.isDisabled()) return true; + if (ModuleManager.scaffold.isEnabled()) return true; return stopOnHurt.isToggled() && mc.thePlayer.hurtTime > 0; } } diff --git a/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/lowhop/HypixelLowHopMotionSpeed.java b/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/lowhop/HypixelLowHopMotionSpeed.java new file mode 100644 index 000000000..bcb51660e --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/lowhop/HypixelLowHopMotionSpeed.java @@ -0,0 +1,42 @@ +package keystrokesmod.module.impl.movement.speed.hypixel.lowhop; + +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.module.impl.movement.speed.hypixel.HypixelLowHopSpeed; +import keystrokesmod.module.setting.impl.SubMode; +import keystrokesmod.utility.MoveUtil; +import keystrokesmod.utility.Utils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.jetbrains.annotations.NotNull; + +public class HypixelLowHopMotionSpeed extends SubMode { + + public HypixelLowHopMotionSpeed(String name, @NotNull HypixelLowHopSpeed parent) { + super(name, parent); + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent event) { + if (!MoveUtil.isMoving() || parent.parent.parent.noAction()) return; + + if (parent.parent.parent.offGroundTicks == 0) { + if (!Utils.jumpDown()) { + MoveUtil.strafe(MoveUtil.getAllowedHorizontalDistance() - Math.random() / 100f); + mc.thePlayer.jump(); + } + } else if (parent.noLowHop() || MoveUtil.getJumpEffect() != 0) { + return; + } + + switch (parent.parent.parent.offGroundTicks) { + case 1: + mc.thePlayer.motionY = 0.39; + break; + case 3: + mc.thePlayer.motionY -= 0.13; + break; + case 4: + mc.thePlayer.motionY -= 0.2; + break; + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/lowhop/HypixelLowHopPredictSpeed.java b/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/lowhop/HypixelLowHopPredictSpeed.java index a8794d559..1fdd02138 100644 --- a/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/lowhop/HypixelLowHopPredictSpeed.java +++ b/src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/lowhop/HypixelLowHopPredictSpeed.java @@ -1,6 +1,6 @@ package keystrokesmod.module.impl.movement.speed.hypixel.lowhop; -import keystrokesmod.event.PrePlayerInputEvent; +import keystrokesmod.event.PreUpdateEvent; import keystrokesmod.module.impl.movement.speed.hypixel.HypixelLowHopSpeed; import keystrokesmod.module.setting.impl.SubMode; import keystrokesmod.utility.MoveUtil; @@ -14,7 +14,7 @@ public HypixelLowHopPredictSpeed(String name, @NotNull HypixelLowHopSpeed parent } @SubscribeEvent - public void onPrePlayerInput(PrePlayerInputEvent event) { + public void onPreUpdate(PreUpdateEvent event) { if (!MoveUtil.isMoving() || parent.parent.parent.noAction()) return; if (parent.parent.parent.offGroundTicks == 0) { if (!Utils.jumpDown()) { diff --git a/src/main/java/keystrokesmod/module/impl/render/Ambience.java b/src/main/java/keystrokesmod/module/impl/render/Ambience.java index 55cbebb22..fcd9cc06d 100644 --- a/src/main/java/keystrokesmod/module/impl/render/Ambience.java +++ b/src/main/java/keystrokesmod/module/impl/render/Ambience.java @@ -3,11 +3,14 @@ import keystrokesmod.event.PreMotionEvent; import keystrokesmod.event.ReceivePacketEvent; import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; import keystrokesmod.module.setting.impl.ModeSetting; import keystrokesmod.module.setting.impl.SliderSetting; import keystrokesmod.utility.Utils; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.network.play.server.S03PacketTimeUpdate; import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraftforge.client.event.EntityViewRenderEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import org.jetbrains.annotations.NotNull; @@ -16,7 +19,10 @@ public class Ambience extends Module { private final SliderSetting time; private final SliderSetting speed; private final ModeSetting weather; - + private final ButtonSetting fogColor; + private final SliderSetting fogColorRed; + private final SliderSetting fogColorGreen; + private final SliderSetting fogColorBlue; public Ambience() { super("Ambience", category.render); @@ -25,6 +31,11 @@ public Ambience() { String[] MODES = new String[]{"Unchanged", "Clear", "Rain"}; this.registerSetting(weather = new ModeSetting("Weather", MODES, 0)); + + this.registerSetting(fogColor = new ButtonSetting("Fog color", false)); + this.registerSetting(fogColorRed = new SliderSetting("Fog color red", 100, 0, 255, 1, fogColor::isToggled)); + this.registerSetting(fogColorGreen = new SliderSetting("Fog color green", 100, 0, 255, 1, fogColor::isToggled)); + this.registerSetting(fogColorBlue = new SliderSetting("Fog color blue", 100, 0, 255, 1, fogColor::isToggled)); } @Override @@ -42,12 +53,6 @@ private void reset() { mc.theWorld.getWorldInfo().setThundering(false); } - @SubscribeEvent - public void onRenderTick(TickEvent.RenderTickEvent event) { - if (!Utils.nullCheck()) return; - mc.theWorld.setWorldTime((long) (time.getInput() + (System.currentTimeMillis() * speed.getInput()))); - } - @SubscribeEvent public void onPreMotion(PreMotionEvent event) { if (!Utils.nullCheck()) return; @@ -81,4 +86,19 @@ public void onReceivePacket(@NotNull ReceivePacketEvent event) { } } } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent event) { + if (!Utils.nullCheck() || event.phase != TickEvent.Phase.END) return; + mc.theWorld.setWorldTime((long) (time.getInput() + (System.currentTimeMillis() * speed.getInput()))); + } + + @SubscribeEvent + public void onFogColors(EntityViewRenderEvent.@NotNull FogColors event) { + if (!fogColor.isToggled()) return; + + event.red = (float) fogColorRed.getInput(); + event.green = (float) fogColorGreen.getInput(); + event.blue = (float) fogColorBlue.getInput(); + } } diff --git a/src/main/java/keystrokesmod/module/impl/render/Animations.java b/src/main/java/keystrokesmod/module/impl/render/Animations.java index e2b055fa9..12a6fd770 100644 --- a/src/main/java/keystrokesmod/module/impl/render/Animations.java +++ b/src/main/java/keystrokesmod/module/impl/render/Animations.java @@ -15,7 +15,6 @@ import net.minecraft.item.ItemMap; import net.minecraft.item.ItemStack; import net.minecraft.network.play.client.C0APacketAnimation; -import net.minecraft.network.play.server.S0BPacketAnimation; import net.minecraft.util.MathHelper; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.jetbrains.annotations.NotNull; @@ -32,12 +31,13 @@ public class Animations extends Module { private final SliderSetting y = new SliderSetting("Y", 0, -1, 1, 0.05); private final SliderSetting z = new SliderSetting("Z", 0, -1, 1, 0.05); private final SliderSetting swingSpeed = new SliderSetting("Swing speed", 0, -200, 50, 5); + private final SliderSetting swingSpeedWhileBlocking = new SliderSetting("Swing speed while blocking", 0, -200, 50, 5); private int swing; public Animations() { super("Animations", category.render); - this.registerSetting(blockAnimation, swingAnimation, otherAnimation, swingWhileDigging, clientSide, fakeSlotReset, x, y, z, swingSpeed); + this.registerSetting(blockAnimation, swingAnimation, otherAnimation, swingWhileDigging, clientSide, fakeSlotReset, x, y, z, swingSpeed, swingSpeedWhileBlocking); } @SubscribeEvent @@ -52,18 +52,15 @@ public void onSendPacket(SendPacketEvent event) { } @SubscribeEvent - public void onReceivePacket(ReceivePacketEvent event) { + public void onPreUpdate(PreUpdateEvent event) { if (Utils.nullCheck() && fakeSlotReset.isToggled() - && event.getPacket() instanceof S0BPacketAnimation - && SlotHandler.getHeldItem() != null - && SlotHandler.getCurrentSlot() == mc.thePlayer.inventory.currentItem + && !SlotHandler.isSilentSlot() && KillAura.target != null + && KillAura.target.hurtTime != 0 + && KillAura.target.hurtTime == KillAura.target.maxHurtTime ) { - final S0BPacketAnimation packet = (S0BPacketAnimation) event.getPacket(); - if (packet.getAnimationType() == 1 && packet.getEntityID() == KillAura.target.getEntityId()) { - mc.getItemRenderer().resetEquippedProgress(); - } + mc.getItemRenderer().resetEquippedProgress(); } } @@ -280,7 +277,11 @@ public void onPreMotion(PreMotionEvent event) { @SubscribeEvent public void onSwingAnimation(@NotNull SwingAnimationEvent event) { - event.setAnimationEnd(event.getAnimationEnd() * (int) ((-swingSpeed.getInput() / 100) + 1)); + if (mc.thePlayer.getItemInUseCount() == 1 || mc.thePlayer.isUsingItem()) { + event.setAnimationEnd((int) (event.getAnimationEnd() * ((-swingSpeedWhileBlocking.getInput() / 100) + 1))); + } else { + event.setAnimationEnd((int) (event.getAnimationEnd() * ((-swingSpeed.getInput() / 100) + 1))); + } } private void translate(double x, double y, double z) { diff --git a/src/main/java/keystrokesmod/module/impl/render/Watermark.java b/src/main/java/keystrokesmod/module/impl/render/Watermark.java index c9a29f371..a8a1443ba 100644 --- a/src/main/java/keystrokesmod/module/impl/render/Watermark.java +++ b/src/main/java/keystrokesmod/module/impl/render/Watermark.java @@ -27,7 +27,7 @@ import java.util.Objects; public class Watermark extends Module { - public static final String VERSION = "2.12"; + public static final String VERSION = "2.13"; public static final HashMap WATERMARK = new HashMap<>(); public static String customName = "CustomClient"; diff --git a/src/main/java/keystrokesmod/module/impl/world/Scaffold.java b/src/main/java/keystrokesmod/module/impl/world/Scaffold.java index 4161e7c2c..984277967 100644 --- a/src/main/java/keystrokesmod/module/impl/world/Scaffold.java +++ b/src/main/java/keystrokesmod/module/impl/world/Scaffold.java @@ -10,7 +10,6 @@ import keystrokesmod.module.impl.other.RotationHandler; import keystrokesmod.module.impl.other.SlotHandler; import keystrokesmod.module.impl.other.anticheats.utils.world.PlayerRotation; -import keystrokesmod.module.impl.render.HUD; import keystrokesmod.module.impl.world.scaffold.IScaffoldRotation; import keystrokesmod.module.impl.world.scaffold.IScaffoldSprint; import keystrokesmod.module.impl.world.scaffold.rotation.*; @@ -49,11 +48,13 @@ public class Scaffold extends IAutoClicker { private static final String[] precisionModes = new String[]{"Very low", "Low", "Moderate", "High", "Very high", "Unlimited"}; - public final SliderSetting motion; - public final ButtonSetting safeWalk; + + private final SliderSetting motion; + private final ButtonSetting safeWalk; + private final ButtonSetting safeWalkOnNoBlocks; public final ButtonSetting tower; - public final ButtonSetting sameY; - public final ButtonSetting autoJump; + private final ButtonSetting sameY; + private final ButtonSetting autoJump; private final ModeValue clickMode; private final ButtonSetting alwaysPlaceIfPossible; private final SliderSetting aimSpeed; @@ -83,7 +84,6 @@ public class Scaffold extends IAutoClicker { private final ButtonSetting autoSwap; private final ButtonSetting useBiggestStack; private final ButtonSetting fastOnRMB; - private final ButtonSetting highlightBlocks; private final ButtonSetting multiPlace; private final ButtonSetting showBlockCount; private final ButtonSetting delayOnJump; @@ -95,7 +95,13 @@ public class Scaffold extends IAutoClicker { private final ButtonSetting polar; private final ButtonSetting postPlace; private final ButtonSetting lookView; - private final ButtonSetting cancelSprintAtStart; + private final ButtonSetting stopSprintAtStart; + private final ButtonSetting esp; + private final ModeSetting theme; + private final ButtonSetting raytrace; + private final SliderSetting alpha; + private final ButtonSetting outline; + private final ButtonSetting shade; private final Map highlight = new HashMap<>(); public @Nullable MovingObjectPosition rayCasted = null; @@ -123,6 +129,7 @@ public class Scaffold extends IAutoClicker { private HoverState hoverState = HoverState.DONE; private boolean stopMoving = false; private double lastOffsetToMid = -1; + private MovingObjectPosition lastESPRaytrace = null; public Scaffold() { super("Scaffold", category.world); @@ -184,11 +191,12 @@ public Scaffold() { this.registerSetting(useBiggestStack = new ButtonSetting("Use biggest stack", true, autoSwap::isToggled)); this.registerSetting(delayOnJump = new ButtonSetting("Delay on jump", true)); this.registerSetting(fastOnRMB = new ButtonSetting("Fast on RMB", false)); - this.registerSetting(highlightBlocks = new ButtonSetting("Highlight blocks", true)); this.registerSetting(multiPlace = new ButtonSetting("Multi-place", false)); this.registerSetting(safeWalk = new ButtonSetting("Safewalk", true)); + this.registerSetting(safeWalkOnNoBlocks = new ButtonSetting("Safewalk on no blocks", true)); this.registerSetting(showBlockCount = new ButtonSetting("Show block count", true)); this.registerSetting(stopAtStart = new ButtonSetting("Stop at start", false)); + this.registerSetting(stopSprintAtStart = new ButtonSetting("Stop sprint at start", false)); this.registerSetting(silentSwing = new ButtonSetting("Silent swing", false)); this.registerSetting(noSwing = new ButtonSetting("No swing", false, silentSwing::isToggled)); this.registerSetting(tower = new ButtonSetting("Tower", false)); @@ -199,7 +207,13 @@ public Scaffold() { this.registerSetting(polar = new ButtonSetting("Polar", false, expand::isToggled)); this.registerSetting(postPlace = new ButtonSetting("Post place", false, "Place on PostUpdate.")); this.registerSetting(lookView = new ButtonSetting("Look view", false)); - this.registerSetting(cancelSprintAtStart = new ButtonSetting("Cancel sprint at start", false)); + this.registerSetting(new DescriptionSetting("Rendering")); + this.registerSetting(esp = new ButtonSetting("ESP", false)); + this.registerSetting(theme = new ModeSetting("Theme", Theme.themes, 0)); + this.registerSetting(raytrace = new ButtonSetting("Raytrace", false, esp::isToggled)); + this.registerSetting(alpha = new SliderSetting("Alpha", 200, 0, 255, 1, () -> esp.isToggled() && raytrace.isToggled())); + this.registerSetting(outline = new ButtonSetting("Outline", true, esp::isToggled)); + this.registerSetting(shade = new ButtonSetting("Shade", false, esp::isToggled)); } public static boolean sprint() { @@ -211,6 +225,13 @@ public static boolean sprint() { return false; } + @SubscribeEvent + public void onSprint(SprintEvent event) { + if (!sprint()) { + event.setSprint(false); + } + } + public static int getSlot() { int slot = -1; int highestStack = -1; @@ -250,6 +271,7 @@ public void onDisable() { lastYaw = lastPitch = null; polar$waitingForExpand = false; lastOffsetToMid = -1; + lastESPRaytrace = null; Utils.resetTimer(); } @@ -273,7 +295,7 @@ public void onEnable() { stopMoving = true; } - if (cancelSprintAtStart.isToggled()) { + if (stopSprintAtStart.isToggled()) { mc.thePlayer.setSprinting(false); } @@ -769,22 +791,50 @@ public double groundDistance() { @SubscribeEvent public void onRenderWorld(RenderWorldLastEvent e) { - if (!Utils.nullCheck() || !highlightBlocks.isToggled() || highlight.isEmpty()) { + if (!Utils.nullCheck() || !esp.isToggled()) { return; } - Iterator> iterator = highlight.entrySet().iterator(); - while (iterator.hasNext()) { - Map.Entry entry = iterator.next(); - if (entry.getValue() == null) { - entry.setValue(new Timer(750)); - entry.getValue().start(); + if (!highlight.isEmpty()) { + Iterator> iterator = highlight.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + if (entry.getValue() == null) { + entry.setValue(new Timer(750)); + entry.getValue().start(); + } + int alpha = entry.getValue() == null ? 210 : 210 - entry.getValue().getValueInt(0, 210, 1); + if (alpha == 0) { + iterator.remove(); + continue; + } + + if (!raytrace.isToggled()) { + RenderUtils.renderBlock(entry.getKey(), + Utils.merge(Theme.getGradient((int) theme.getInput(), 0), alpha), + outline.isToggled(), shade.isToggled() + ); + } + } + } + + if (raytrace.isToggled()) { + MovingObjectPosition hitResult = mc.objectMouseOver; + if (hitResult.typeOfHit == MovingObjectPosition.MovingObjectType.MISS) { + hitResult = lastESPRaytrace; + } else { + lastESPRaytrace = hitResult; + } + + if (hitResult == null) { + hitResult = placeBlock; } - int alpha = entry.getValue() == null ? 210 : 210 - entry.getValue().getValueInt(0, 210, 1); - if (alpha == 0) { - iterator.remove(); - continue; + + if (hitResult != null && hitResult.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + RenderUtils.renderBlock(hitResult.getBlockPos(), + Utils.merge(Theme.getGradient((int) theme.getInput(), 0), (int) alpha.getInput()), + outline.isToggled(), shade.isToggled() + ); } - RenderUtils.renderBlock(entry.getKey(), Utils.merge(Theme.getGradient((int) HUD.theme.getInput(), 0), alpha), true, false); } } @@ -798,7 +848,7 @@ public boolean keepYPosition() { } public boolean safewalk() { - return this.isEnabled() && safeWalk.isToggled(); + return this.isEnabled() && (safeWalk.isToggled() || (safeWalkOnNoBlocks.isToggled() && totalBlocks() == 0)); } public boolean stopRotation() { diff --git a/src/main/java/keystrokesmod/module/impl/world/tower/HypixelTower.java b/src/main/java/keystrokesmod/module/impl/world/tower/HypixelTower.java index 981a85dbc..4c14a2acd 100644 --- a/src/main/java/keystrokesmod/module/impl/world/tower/HypixelTower.java +++ b/src/main/java/keystrokesmod/module/impl/world/tower/HypixelTower.java @@ -43,7 +43,7 @@ public class HypixelTower extends SubMode { public HypixelTower(String name, @NotNull Tower parent) { super(name, parent); this.registerSetting(notWhileMoving = new ButtonSetting("Not while moving", true)); - this.registerSetting(airStrafeAmount = new SliderSetting("Air strafe amount", 20, 15, 90, 5)); + this.registerSetting(airStrafeAmount = new SliderSetting("Air strafe amount", 0, 0, 15, 5)); this.registerSetting(stopOnBlocks = new SliderSetting("Stop on blocks", 6, 6, 10, 1)); } diff --git a/src/main/java/keystrokesmod/utility/MoveUtil.java b/src/main/java/keystrokesmod/utility/MoveUtil.java index f4889b521..8dba818fd 100644 --- a/src/main/java/keystrokesmod/utility/MoveUtil.java +++ b/src/main/java/keystrokesmod/utility/MoveUtil.java @@ -218,12 +218,17 @@ public static int getSpeedEffect() { return 0; } + public static int getJumpEffect() { + if (mc.thePlayer.isPotionActive(Potion.jump)) + return mc.thePlayer.getActivePotionEffect(Potion.jump).getAmplifier() + 1; + return 0; + } + /** * Checks if the player is moving * * @return player moving */ - @Contract(pure = true) public static boolean isMoving() { return isMoving(mc.thePlayer); } @@ -233,7 +238,6 @@ public static boolean isMoving(@NotNull EntityLivingBase entity) { return entity.moveForward != 0 || entity.moveStrafing != 0; } - @Contract(pure = true) public static boolean isRealMoving() { return mc.thePlayer.motionX != 0 || (mc.thePlayer.motionY != 0 && !mc.thePlayer.onGround) || mc.thePlayer.motionZ != 0; }