summaryrefslogtreecommitdiff
path: root/src/main/java/com/arslaancodes/arslaansmagichax/modules/impl/NoFall.java
blob: 927b435a4a6dce8c8c197be35839fb26ddea671a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.arslaancodes.arslaansmagichax.modules.impl;

import com.arslaancodes.arslaansmagichax.modules.Category;
import com.arslaancodes.arslaansmagichax.modules.Module;
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;

public class NoFall extends Module {
    public NoFall() {
        super("NoFall", "Negates fall damage.", -1, Category.PLAYER);
    }

    @Override
    public void tick() {
        if (this.isEnabled()) {
            if (mc.player != null) {
                if (!mc.player.onGround() && mc.player.fallDistance > 3) {
                    // magic hax
                    ServerboundMovePlayerPacket packet = new ServerboundMovePlayerPacket.PosRot(mc.player.getX(), mc.player.getY() + 0.000000001, mc.player.getZ(),
                            mc.player.getYRot(), mc.player.getXRot(), false, mc.player.horizontalCollision);
                    mc.player.connection.send(packet);
                }
            }
        }
    }
}