Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Add Panic Module #54

Merged
merged 5 commits into from
Jul 8, 2024
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
4 changes: 3 additions & 1 deletion src/main/java/keystrokesmod/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public class ModuleManager {
public static BlockHit blockHit;
public static FullBright fullBright;
public static ModSpoofer modSpoofer;

public static Panic panic;

public void register() {
this.addModule(autoClicker = new AutoClicker());
this.addModule(longJump = new LongJump());
Expand Down Expand Up @@ -204,6 +205,7 @@ public void register() {
this.addModule(fullBright = new FullBright());
this.addModule(new AutoPot());
this.addModule(modSpoofer = new ModSpoofer());
this.addModule(panic = new Panic());
antiBot.enable();
commandChat.enable();
modSpoofer.enable();
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/keystrokesmod/module/impl/other/Panic.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package keystrokesmod.module.impl.other;

import keystrokesmod.Raven;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import java.util.ArrayList;
import java.util.List;

public class Panic extends Module {
public Panic() {
super("Panic", category.other);
this.registerSetting(new DescriptionSetting("Disables all modules."));
}

@Override
public void onEnable() {
List<Module> modulesToDisable = new ArrayList<>();
for (Module m : Raven.getModuleManager().getModules()) {
if (m.isEnabled()) {
modulesToDisable.add(m);
aazz18 marked this conversation as resolved.
Show resolved Hide resolved
}
}
for (Module m : modulesToDisable) {
m.disable();

}
this.disable();
}
}
14 changes: 13 additions & 1 deletion src/main/java/keystrokesmod/utility/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,18 @@ public static void rCMD(@NotNull String c) {
print("&a" + module.getName() + " is now visible in HUD", 1);
}
}
} else if (args.get(0).equals("rename")) {
} else if (args.get(0).equals("panic")) {
List<Module> modulesToDisable = new ArrayList<>();
aazz18 marked this conversation as resolved.
Show resolved Hide resolved
for (Module m : Raven.getModuleManager().getModules()) {
if (m.isEnabled()) {
modulesToDisable.add(m);
}
}
for (Module m : modulesToDisable) {
m.disable();

}
}else if (args.get(0).equals("rename")) {
coderabbitai[bot] marked this conversation as resolved.
Show resolved Hide resolved
if (!hasArgs) {
print(invSyn, 1);
return;
Expand Down Expand Up @@ -477,6 +488,7 @@ public static void rCMD(@NotNull String c) {
print("6 hide/show [module]", 0);
print("7 rename [module] [name]", 0);
print("8 say [message]", 0);
print("9 panic", 0);
print("&eProfiles:", 0);
print("1 profiles", 0);
print("2 profiles save [profile]", 0);
Expand Down