Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Commit b216e1d

Browse files
committed
Module toggles
1 parent 14b711b commit b216e1d

2 files changed

Lines changed: 70 additions & 3 deletions

File tree

src/main/java/fartenware/systems/FartenWare.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ public void onInitialize() {
3939
MeteorClient.EVENT_BUS.registerLambdaFactory("fartenware.utils", (lookupInMethod, klass) -> (MethodHandles.Lookup) lookupInMethod.invoke(null, klass, MethodHandles.lookup()));
4040

4141
// Placeholders
42-
MeteorStarscript.ss.set("fartenware", new ValueMap()
43-
.set("fartenwatermark", VERSION)
44-
);
42+
MeteorStarscript.ss.set("fartenware", new ValueMap().set("fartenwatermark", VERSION));
4543

4644

4745
// Commands

src/main/java/fartenware/systems/modules/main/BedrockBreaker.java

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
import fartenware.utils.bedrock.Messager;
66
import fartenware.utils.bedrock.TargetBlock;
77
import meteordevelopment.meteorclient.events.world.TickEvent;
8+
import meteordevelopment.meteorclient.settings.*;
89
import meteordevelopment.meteorclient.systems.modules.Module;
10+
import meteordevelopment.meteorclient.systems.modules.Modules;
11+
import meteordevelopment.meteorclient.systems.modules.misc.AntiPacketKick;
12+
import meteordevelopment.meteorclient.systems.modules.player.*;
13+
import meteordevelopment.meteorclient.systems.modules.world.NoGhostBlocks;
14+
import meteordevelopment.meteorclient.systems.modules.world.PacketMine;
15+
import meteordevelopment.meteorclient.systems.modules.world.Timer;
916
import meteordevelopment.orbit.EventHandler;
1017
import net.minecraft.block.Blocks;
1118
import net.minecraft.client.MinecraftClient;
@@ -14,14 +21,76 @@
1421
import net.minecraft.util.math.BlockPos;
1522

1623
import java.util.ArrayList;
24+
import java.util.List;
1725

1826
public class BedrockBreaker extends Module {
27+
private final SettingGroup sgGeneral = settings.getDefaultGroup();
28+
29+
private final Setting<Boolean> toggleModules = sgGeneral.add(new BoolSetting.Builder()
30+
.name("toggle-modules")
31+
.description("Turn off specific modules when BedrockBreaker is activated.")
32+
.defaultValue(true)
33+
.build()
34+
);
35+
36+
private final Setting<Boolean> toggleBack = sgGeneral.add(new BoolSetting.Builder()
37+
.name("toggle-back-on")
38+
.description("Turn the specific modules back on when BedrockBreaker is deactivated.")
39+
.defaultValue(false)
40+
.visible(toggleModules::get)
41+
.build()
42+
);
43+
44+
private final Setting<List<Module>> modules = sgGeneral.add(new ModuleListSetting.Builder()
45+
.name("modules")
46+
.description("Which modules to disable on activation.")
47+
.defaultValue(new ArrayList<>() {{
48+
add(Modules.get().get(AntiHunger.class));
49+
add(Modules.get().get(AntiPacketKick.class));
50+
add(Modules.get().get(AutoClicker.class));
51+
add(Modules.get().get(AutoTool.class));
52+
add(Modules.get().get(BreakDelay.class));
53+
add(Modules.get().get(NoGhostBlocks.class));
54+
add(Modules.get().get(NoMiningTrace.class));
55+
add(Modules.get().get(PacketMine.class));
56+
add(Modules.get().get(Timer.class));
57+
}})
58+
.visible(toggleModules::get)
59+
.build()
60+
);
61+
1962
public BedrockBreaker() {
2063
super(FartenWare.MAIN, "bedrock-breaker", "Breaks bedrock automatically (requires haste 2).");
2164
}
2265

66+
public ArrayList<Module> toActivate;
2367
private static ArrayList<TargetBlock> cachedTargetBlockList = new ArrayList<>();
2468

69+
@Override
70+
public void onActivate() {
71+
toActivate = new ArrayList<>();
72+
73+
if (toggleModules.get() && !modules.get().isEmpty() && mc.world != null && mc.player != null) {
74+
for (Module module : modules.get()) {
75+
if (module.isActive()) {
76+
module.toggle();
77+
toActivate.add(module);
78+
}
79+
}
80+
}
81+
}
82+
83+
@Override
84+
public void onDeactivate() {
85+
if (toggleBack.get() && !toActivate.isEmpty() && mc.world != null && mc.player != null) {
86+
for (Module module : toActivate) {
87+
if (!module.isActive()) {
88+
module.toggle();
89+
}
90+
}
91+
}
92+
}
93+
2594
public static void addBlockPosToList(BlockPos pos) {
2695
ClientWorld world = MinecraftClient.getInstance().world;
2796
if (world.getBlockState(pos).isOf(Blocks.BEDROCK)) {

0 commit comments

Comments
 (0)