Auto Boost
This commit is contained in:
committed by
Cloudburst
parent
b0bf5bd34e
commit
5af1ca1a2f
@@ -1,38 +1,67 @@
|
|||||||
package anticope.rejects.modules;
|
package anticope.rejects.modules;
|
||||||
|
|
||||||
import anticope.rejects.MeteorRejectsAddon;
|
import anticope.rejects.MeteorRejectsAddon;
|
||||||
|
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||||
|
import meteordevelopment.meteorclient.settings.*;
|
||||||
|
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||||
|
import meteordevelopment.orbit.EventHandler;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
import meteordevelopment.meteorclient.settings.DoubleSetting;
|
|
||||||
import meteordevelopment.meteorclient.settings.Setting;
|
|
||||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
|
||||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
|
||||||
|
|
||||||
public class Boost extends Module {
|
public class Boost extends Module {
|
||||||
|
|
||||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||||
|
|
||||||
private final Setting<Double> strength = sgGeneral.add(new DoubleSetting.Builder()
|
private final Setting<Double> strength = sgGeneral.add(new DoubleSetting.Builder()
|
||||||
.name("strength")
|
.name("strength")
|
||||||
.description("Strength to yeet you with.")
|
.description("Strength to yeet you with.")
|
||||||
.defaultValue(4.0)
|
.defaultValue(4.0)
|
||||||
.min(0.5)
|
.sliderMax(10)
|
||||||
.sliderMax(10)
|
.build()
|
||||||
.build()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
private final Setting<Boolean> autoBoost = sgGeneral.add(new BoolSetting.Builder()
|
||||||
|
.name("auto-boost")
|
||||||
|
.description("Automatically boosts you.")
|
||||||
|
.defaultValue(false)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
private final Setting<Integer> interval = sgGeneral.add(new IntSetting.Builder()
|
||||||
|
.name("interval")
|
||||||
|
.description("Boost interval in ticks.")
|
||||||
|
.visible(autoBoost::get)
|
||||||
|
.defaultValue(20)
|
||||||
|
.sliderMax(120)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
private int timer = 0;
|
||||||
|
|
||||||
public Boost() {
|
public Boost() {
|
||||||
super(MeteorRejectsAddon.CATEGORY, "boost", "Works like a dash move.");
|
super(MeteorRejectsAddon.CATEGORY, "boost", "Works like a dash move.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivate() {
|
public void onActivate() {
|
||||||
if (mc.player == null) {
|
timer = interval.get();
|
||||||
|
if (!autoBoost.get()) {
|
||||||
|
if (mc.player != null) boost();
|
||||||
this.toggle();
|
this.toggle();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
private void onTick(TickEvent.Pre event) {
|
||||||
|
if (!autoBoost.get()) return;
|
||||||
|
if (timer < 1) {
|
||||||
|
boost();
|
||||||
|
timer = interval.get();
|
||||||
|
} else {
|
||||||
|
timer--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void boost() {
|
||||||
Vec3d v = mc.player.getRotationVecClient().multiply(strength.get());
|
Vec3d v = mc.player.getRotationVecClient().multiply(strength.get());
|
||||||
mc.player.addVelocity(v.getX(), v.getY(), v.getZ());
|
mc.player.addVelocity(v.getX(), v.getY(), v.getZ());
|
||||||
this.toggle();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user