Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fixed.liquiddev.modules.Movement;
- import org.lwjgl.input.Keyboard;
- import fixed.liquiddev.modules.Category;
- import fixed.liquiddev.modules.MODULE;
- import fixed.liquiddev.ui.Wrapper;
- import net.minecraft.network.play.client.C03PacketPlayer;
- public class Module_Fly extends MODULE {
- public Module_Fly() {
- super("Fly", "fly", Keyboard.KEY_G, Category.MOVEMENT);
- }
- String mode = "vanilla";
- @Override
- public void onUpdate() {
- if (!this.isEnabled()) {
- lastYaw = mc.thePlayer.rotationYaw;
- i = 0;
- return;
- }
- if (mode.equalsIgnoreCase("vanilla"))
- Wrapper.mc.thePlayer.capabilities.isFlying = true;
- else if (mode.equalsIgnoreCase("aac")) {
- aac305();
- }
- super.onUpdate();
- }
- @Override
- public void onCommand(String[] args) {
- if (args.length == 2) {
- if (args[0].toString().equalsIgnoreCase("mode")) {
- this.mode = args[1].toString();
- Wrapper.addChat("§aMode ist now " + mode);
- return;
- } else if (args[0].toString().equalsIgnoreCase("glide")) {
- this.glideMove = Float.valueOf(args[1].toString());
- Wrapper.addChat("§aGlide ist now " + glide);
- return;
- }
- return;
- }
- Wrapper.addChat("§cWrong args: .fly <mode/glide> <[mode]/[glide]>");
- super.onCommand(args);
- }
- @Override
- public void onDisable() {
- Wrapper.mc.thePlayer.capabilities.isFlying = false;
- super.onDisable();
- }
- boolean isDoing = false;
- boolean glide = false;
- int i = 0;;
- float lastYaw = 0;
- float glideMove = 0.7f;
- @Override
- public void onEnable() {
- if (mc.thePlayer != null && mc.thePlayer.worldObj != null && mc.thePlayer.worldObj.isRemote) {
- lastYaw = mc.thePlayer.rotationYaw;
- mc.thePlayer.jump();
- glide = true;
- move(mc.thePlayer.rotationYaw, 0.02f);
- }
- super.onEnable();
- }
- public void aac305() {
- mc.thePlayer.setSprinting(true);
- // Exploit to set lastFlag in air
- if (glide && mc.thePlayer.fallDistance > 0.02 && mc.thePlayer.fallDistance < 0.8) {
- move(mc.thePlayer.rotationYaw, glideMove);
- lastYaw = mc.thePlayer.rotationYaw;
- return;
- }
- // End?
- if (mc.thePlayer.fallDistance < 0.6 || mc.thePlayer.motionY >= -0.1) {
- lastYaw = mc.thePlayer.rotationYaw;
- return;
- }
- glide = false;
- // do the Flag
- if (isDoing == false) {
- mc.thePlayer.motionY = -0.0;
- isDoing = true;
- lastYaw = mc.thePlayer.rotationYaw;
- return;
- }
- // Motion up
- mc.thePlayer.motionY = 0.1;
- // Motion forward
- if (Math.abs(lastYaw - mc.thePlayer.rotationYaw) < 3) {
- if (i == 0) {
- move(mc.thePlayer.rotationYaw, 0.3f);
- } else {
- move(mc.thePlayer.rotationYaw, 0.18f);
- }
- } else {
- move(mc.thePlayer.rotationYaw, 0.08f);
- i = 1;
- }
- // set last yaw
- lastYaw = mc.thePlayer.rotationYaw;
- super.onUpdate();
- }
- public void move(float yaw, float multiplyer, float up) {
- // double moveX = -Math.sin(Math.toRadians(yaw)) * 0.1644;
- double moveX = -Math.sin(Math.toRadians(yaw)) * multiplyer;
- double moveZ = Math.cos(Math.toRadians(yaw)) * multiplyer;
- double moveY = up;
- Wrapper.mc.thePlayer.motionX = moveX;
- Wrapper.mc.thePlayer.motionY = moveY;
- Wrapper.mc.thePlayer.motionZ = moveZ;
- }
- public void move(float yaw, float multiplyer) {
- double moveX = -Math.sin(Math.toRadians(yaw)) * multiplyer;
- double moveZ = Math.cos(Math.toRadians(yaw)) * multiplyer;
- Wrapper.mc.thePlayer.motionX = moveX;
- Wrapper.mc.thePlayer.motionZ = moveZ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement