Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fly #27

Merged
merged 3 commits into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();

}
}