broken shit
This commit is contained in:
parent
0edfc893ab
commit
5ccad6b10a
16 changed files with 149 additions and 24 deletions
|
@ -18,6 +18,6 @@ public abstract class KeyboardMixin {
|
|||
|
||||
@Inject(method = "onKey", at = @At("HEAD"), cancellable = true)
|
||||
public void onKey(long window, int key, int scancode, int action, int modifiers, CallbackInfo info) {
|
||||
if (key == GLFW.GLFW_KEY_RIGHT_SHIFT) MinecraftClient.getInstance().setScreen(ClickGUIScreen.INSTANCE);
|
||||
if (key == GLFW.GLFW_KEY_RIGHT_ALT) MinecraftClient.getInstance().setScreen(ClickGUIScreen.INSTANCE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package me.kawaiizenbo.moonlight.mixin;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import me.kawaiizenbo.moonlight.util.ISimpleOption;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.option.SimpleOption;
|
||||
|
||||
@Mixin(SimpleOption.class)
|
||||
public class SimpleOptionMixin<T> implements ISimpleOption<T>
|
||||
{
|
||||
@Shadow T value;
|
||||
@Shadow @Final private Consumer<T> changeCallback;
|
||||
|
||||
@Override
|
||||
public void setValueUnrestricted(T object)
|
||||
{
|
||||
if (!MinecraftClient.getInstance().isRunning())
|
||||
{
|
||||
this.value = object;
|
||||
return;
|
||||
}
|
||||
if (!Objects.equals(this.value, object))
|
||||
{
|
||||
this.value = object;
|
||||
this.changeCallback.accept(this.value);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue