Skip to content

Commit

Permalink
add fly
Browse files Browse the repository at this point in the history
  • Loading branch information
majorsopa committed Jun 11, 2021
1 parent 1ee3734 commit 53356dc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/com/evaan/frostburn/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import com.evaan.frostburn.module.modules.combat.*;
import com.evaan.frostburn.module.modules.misc.*;
import com.evaan.frostburn.module.modules.movement.Jesus;
import com.evaan.frostburn.module.modules.movement.NoFall;
import com.evaan.frostburn.module.modules.movement.SafeWalk;
import com.evaan.frostburn.module.modules.movement.Sprint;
import com.evaan.frostburn.module.modules.movement.*;
import com.evaan.frostburn.module.modules.render.*;

import java.util.ArrayList;
Expand Down Expand Up @@ -50,6 +47,7 @@ public static void init() {
modules.add(new CleanChat());
modules.add(new MiddleClick());
modules.add(new ImGuiMod());
modules.add(new Fly());

modules.sort(Comparator.comparing(object -> object.name)); //sort the modules alphabetically
}
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/com/evaan/frostburn/module/modules/movement/Fly.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.evaan.frostburn.module.modules.movement;

import com.evaan.frostburn.module.Module;
import net.minecraft.entity.player.PlayerAbilities;

public class Fly extends Module {
public Fly() {super("Fly", Module.Category.MOVEMENT);}

@Override
public void onUpdate() {
assert mc.player != null;

PlayerAbilities abilities = mc.player.getAbilities();
abilities.flying = true;

mc.player.sendAbilitiesUpdate();
}

@Override
public void onDisable() {
assert mc.player != null;

PlayerAbilities abilities = mc.player.getAbilities();
abilities.flying = false;

mc.player.sendAbilitiesUpdate();

}
}

0 comments on commit 53356dc

Please sign in to comment.