Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
revert timerrange
Browse files Browse the repository at this point in the history
  • Loading branch information
xia-mc committed Jul 9, 2024
1 parent 3549d52 commit cc193c3
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions src/main/java/keystrokesmod/module/impl/combat/TimerRange.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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));
Expand All @@ -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();
}
Expand All @@ -87,7 +67,6 @@ public void onDisable() {
lastTimerTime = 0;
lastLagTime = 0;
hasLag = 0;
Utils.resetTimer();
}

private boolean shouldStart() {
Expand Down

0 comments on commit cc193c3

Please sign in to comment.