Base functions and first module #1
@ -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);
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user