broken shit

This commit is contained in:
kawaiizenbo 2023-06-11 10:59:20 -07:00
parent 0edfc893ab
commit 5ccad6b10a
16 changed files with 149 additions and 24 deletions

View file

@ -1,5 +1,8 @@
package me.kawaiizenbo.moonlight.module.settings;
import java.lang.reflect.Method;
import me.kawaiizenbo.moonlight.util.ReflectionUtils;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.text.Text;
@ -7,10 +10,11 @@ public class BooleanSetting extends Setting
{
public boolean value;
public BooleanSetting(String name, boolean value)
public BooleanSetting(String name, boolean value, Method onValueChanged)
{
this.name = name;
this.value = value;
this.onValueChanged = onValueChanged;
}
@Override
@ -29,6 +33,7 @@ public class BooleanSetting extends Setting
if (hovered((int)mouseX, (int)mouseY) && button == 0)
{
this.value = !value;
ReflectionUtils.tryCallMethod(onValueChanged, new Object[0]);
}
}
}