Base functions and first module #1

Merged
c0de merged 18 commits from initial-functions into main 2023-03-22 23:20:13 +00:00
2 changed files with 9 additions and 3 deletions
Showing only changes of commit 7821cf311e - Show all commits

View File

@ -34,6 +34,14 @@ public abstract class Module {
return key; return key;
} }
public void toggleKey() {
if (key != null) {
if (key.wasPressed()) {
this.setState(!this.isState());
}
}
}
public boolean isState() { public boolean isState() {
return state; return state;
} }

View File

@ -17,9 +17,7 @@ public class Fullbright extends Module {
@Override @Override
public void onTick(MinecraftClient client) { public void onTick(MinecraftClient client) {
if (key.wasPressed()) { this.toggleKey();
this.setState(!this.isState());
}
if (this.isState()) { if (this.isState()) {
c0deFoxModClient.LOGGER.warn("Active State"); c0deFoxModClient.LOGGER.warn("Active State");