broken shit
This commit is contained in:
parent
0edfc893ab
commit
5ccad6b10a
16 changed files with 149 additions and 24 deletions
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue