Skip to content

Commit

Permalink
Merge pull request #27 from majorsopa/main
Browse files Browse the repository at this point in the history
add fly
  • Loading branch information
evaan authored Jun 11, 2021
2 parents f618638 + 754003f commit f2af08c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 13 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
21 changes: 12 additions & 9 deletions src/main/java/com/evaan/frostburn/module/modules/misc/Nuker.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,19 @@ public void onUpdate() {
}
}

if (faceBlock.getValue()) {
mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, Vec3d.of(blocks.get(0)));
}

Iterator<BlockPos> blocksIter = blocks.iterator();
for (int j = 0; j < blocks.size(); j++) {
if (j < blocksToMine.getValue() && blocksIter.hasNext()) {
breakBlock(blocksIter.next());
} else {
break;
if (blocks.size() > 0) {
if (faceBlock.getValue()) {
mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, Vec3d.of(blocks.get(0)));
}

Iterator<BlockPos> blocksIter = blocks.iterator();
for (int j = 0; j < blocks.size(); j++) {
if (j < blocksToMine.getValue() && blocksIter.hasNext()) {
breakBlock(blocksIter.next());
} else {
break;
}
}
}

Expand Down
42 changes: 42 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,42 @@
package com.evaan.frostburn.module.modules.movement;

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

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

Setting<Float> speed = register(
new Setting(
"Speed",
this,
100f,
1f,
500f
)
);

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

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

abilities.setFlySpeed(speed.getValue() / 5000);

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 f2af08c

Please sign in to comment.