Improved ElytraFly (seriously, who wrote this shit)

This commit is contained in:
Alex 2020-04-21 19:14:16 +02:00
parent 815665536a
commit 0146d600e7
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
1 changed files with 10 additions and 27 deletions

View File

@ -29,12 +29,15 @@ public final class ElytraFlyModule extends Module {
}
public final Value<Float> speed = new Value<Float>("Speed", new String[]{"Spd"}, "Speed multiplier for elytra flight, higher values equals more speed.", 1.0f, 0.0f, 5.0f, 0.01f);
public final Value<Float> delay = new Value<Float>("Delay", new String[]{"delay,dly"}, "Delay to start the elytra after the space press.", 250.0f, 0.0f, 500.0f, 1000.0f);
public final Value<Boolean> autoStart = new Value<Boolean>("AutoStart", new String[]{"AutoStart", "start", "autojump"}, "Hold down the jump key to have an easy automated lift off.", true);
public final Value<Boolean> disableInLiquid = new Value<Boolean>("DisableInLiquid", new String[]{"DisableInWater", "DisableInLava", "disableliquid", "liquidoff", "noliquid"}, "Disables all elytra flight when the player is in contact with liquid.", true);
public final Value<Boolean> infiniteDurability = new Value<Boolean>("InfiniteDurability", new String[]{"InfiniteDura", "dura", "inf", "infdura"}, "Enables an old exploit that sends the start elytra-flying packet each tick.", false);
public final Value<Boolean> noKick = new Value<Boolean>("NoKick", new String[]{"AntiKick", "Kick"}, "Bypass the server kicking you for flying while in elytra flight (Only works for Packet mode!).", true);
public final Value<Boolean> fallStart = new Value<Boolean>("FallAuto", new String[]{"FallToStart","fallstart"}, "Only autostart if falling.", true);
private final Timer timer = new Timer();
public ElytraFlyModule() {
@ -75,8 +78,13 @@ public final class ElytraFlyModule extends Module {
// automatic jump start
if (this.autoStart.getValue()) {
if (mc.gameSettings.keyBindJump.isKeyDown() && !mc.player.isElytraFlying()) { // jump is held, player is not elytra flying
if (mc.player.motionY < 0) { // player motion is falling
if (this.timer.passed(250)) { // 250 ms
if (this.fallStart.getValue() && mc.player.motionY < 0) { // player motion is falling
if (this.timer.passed(this.delay.getValue())) {
mc.getConnection().sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
this.timer.reset();
}
} else {
if (this.timer.passed(this.delay.getValue())) {
mc.getConnection().sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
this.timer.reset();
}
@ -174,31 +182,6 @@ public final class ElytraFlyModule extends Module {
}
}
@Listener
public void receivePacket(EventReceivePacket event) {
if (event.getStage() == EventStageable.EventStage.PRE) {
if (event.getPacket() instanceof SPacketChat) {
final SPacketChat packet = (SPacketChat) event.getPacket();
if (packet.getChatComponent().getUnformattedText().equalsIgnoreCase("See that bird? *rips wings off*")) {
event.setCanceled(true);
}
if (packet.getChatComponent().getUnformattedText().equalsIgnoreCase("You've been flying for a while.")) {
event.setCanceled(true);
}
if (packet.getChatComponent().getUnformattedText().equalsIgnoreCase("ElytraFly is disabled.")) {
event.setCanceled(true);
}
if (packet.getChatComponent().getUnformattedText().equalsIgnoreCase("Your wings are safe under the Newfag Assisted Flight Temporal Agreement.")) {
event.setCanceled(true);
}
}
}
}
private void freezePlayer(EntityPlayer player) {
player.motionX = 0;
player.motionY = 0;