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 ea798c9cd7 - Show all commits

View File

@ -25,6 +25,8 @@ public class KeybindManager {
final String name = module.getClass().getName(); final String name = module.getClass().getName();
final boolean newState = states.get(name); final boolean newState = states.get(name);
c0deFoxModClient.LOGGER.info(name);
states.put(name, !states.getOrDefault(name, false)); states.put(name, !states.getOrDefault(name, false));
module.setState(newState); module.setState(newState);

View File

@ -2,6 +2,7 @@ package dev.c0de.minecraft.client.modules;
import dev.c0de.minecraft.c0deFoxMod; import dev.c0de.minecraft.c0deFoxMod;
import dev.c0de.minecraft.client.Module; import dev.c0de.minecraft.client.Module;
import dev.c0de.minecraft.client.c0deFoxModClient;
import dev.c0de.minecraft.client.KeybindManager; import dev.c0de.minecraft.client.KeybindManager;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
@ -26,16 +27,19 @@ public class Fullbright extends Module {
@Override @Override
public void onTick(KeybindManager manager, MinecraftClient client) { public void onTick(KeybindManager manager, MinecraftClient client) {
if (state)
update(client, c0deFoxMod.config.getConfig().FULLBRIGHT_GAMMA);
else
update(client, DEFAULT); update(client, DEFAULT);
if (this.isState()) {
c0deFoxModClient.LOGGER.warn("Active State");
update(client, c0deFoxMod.config.getConfig().FULLBRIGHT_GAMMA);
}
} }
private void update(MinecraftClient client, double value) { private void update(MinecraftClient client, double value) {
if (client == null) return; if (client == null) return;
if (client.options.getGamma().getValue() == value) return; if (client.options.getGamma().getValue() == value) return;
c0deFoxModClient.LOGGER.warn("changing gamma");
client.options.getGamma().setValue(value); client.options.getGamma().setValue(value);
if (client.player != null) client.player.sendMessage(Text.of(String.valueOf(value)), true); if (client.player != null) client.player.sendMessage(Text.of(String.valueOf(value)), true);