From cc193c3a3eb5f967c9a1199640056b14dd20f54e Mon Sep 17 00:00:00 2001 From: xia-mc <2052472631@qq.com> Date: Tue, 9 Jul 2024 10:22:08 +0800 Subject: [PATCH] revert timerrange --- .../module/impl/combat/TimerRange.java | 39 +++++-------------- 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/src/main/java/keystrokesmod/module/impl/combat/TimerRange.java b/src/main/java/keystrokesmod/module/impl/combat/TimerRange.java index bd6069f3f..f830724e5 100644 --- a/src/main/java/keystrokesmod/module/impl/combat/TimerRange.java +++ b/src/main/java/keystrokesmod/module/impl/combat/TimerRange.java @@ -5,7 +5,6 @@ import keystrokesmod.module.impl.world.AntiBot; import keystrokesmod.module.setting.impl.ButtonSetting; import keystrokesmod.module.setting.impl.DescriptionSetting; -import keystrokesmod.module.setting.impl.ModeSetting; import keystrokesmod.module.setting.impl.SliderSetting; import keystrokesmod.script.classes.Vec3; import keystrokesmod.utility.Utils; @@ -16,7 +15,6 @@ import java.util.Comparator; public class TimerRange extends Module { - private final ModeSetting orderMode; private final SliderSetting lagTicks; private final SliderSetting timerTicks; private final SliderSetting minRange; @@ -32,7 +30,6 @@ public class TimerRange extends Module { public TimerRange() { super("TimerRange", category.combat); this.registerSetting(new DescriptionSetting("Use timer help you to beat opponent.")); - this.registerSetting(orderMode = new ModeSetting("Order Mode", new String[]{"Pre", "Post"}, 0)); this.registerSetting(lagTicks = new SliderSetting("Lag ticks", 2, 0, 10, 1)); this.registerSetting(timerTicks = new SliderSetting("Timer ticks", 2, 0, 10, 1)); this.registerSetting(minRange = new SliderSetting("Min range", 3.6, 0, 8, 0.1)); @@ -47,37 +44,20 @@ public TimerRange() { public void onRender(TickEvent.RenderTickEvent e) { if (!shouldStart()) return; - switch ((int) orderMode.getInput()) { - case 0: - if (hasLag < lagTicks.getInput()) { - lag(); - return; - } - timer(); - break; - case 1: - timer(); - if (hasLag < lagTicks.getInput()) { - lag(); - return; - } - break; + if (hasLag < lagTicks.getInput()) { + Utils.getTimer().timerSpeed = 0.0F; + if (System.currentTimeMillis() - lastLagTime >= 50) { + hasLag++; + lastLagTime = System.currentTimeMillis(); + } + return; } - } - private void lag() { - Utils.getTimer().timerSpeed = 0.0F; - if (System.currentTimeMillis() - lastLagTime >= 50) { - hasLag++; - lastLagTime = System.currentTimeMillis(); - } - } - - private void timer() { - Utils.resetTimer(); + Utils.getTimer().timerSpeed = 1.0F; for (int i = 0; i < timerTicks.getInput(); i++) { mc.thePlayer.onUpdate(); } + hasLag = 0; lastTimerTime = System.currentTimeMillis(); } @@ -87,7 +67,6 @@ public void onDisable() { lastTimerTime = 0; lastLagTime = 0; hasLag = 0; - Utils.resetTimer(); } private boolean shouldStart() {