26 lines
926 B
Java
26 lines
926 B
Java
package io.gitlab.jfronny.slyde;
|
|
|
|
import net.fabricmc.api.ClientModInitializer;
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.Environment;
|
|
import net.minecraft.client.MinecraftClient;
|
|
import net.minecraft.client.util.InputUtil;
|
|
import org.lwjgl.glfw.GLFW;
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
public class SlydeClient implements ClientModInitializer {
|
|
@Override
|
|
public void onInitializeClient() {
|
|
Cfg.get();
|
|
}
|
|
|
|
public static boolean isActive() {
|
|
long handle = MinecraftClient.getInstance().getWindow().getHandle();
|
|
boolean down = InputUtil.isKeyPressed(handle, GLFW.GLFW_KEY_LEFT_SHIFT)
|
|
|| InputUtil.isKeyPressed(handle, GLFW.GLFW_KEY_RIGHT_SHIFT)
|
|
|| InputUtil.isKeyPressed(handle, GLFW.GLFW_KEY_LEFT_CONTROL)
|
|
|| InputUtil.isKeyPressed(handle, GLFW.GLFW_KEY_RIGHT_CONTROL);
|
|
return down == Cfg.get().holdKeyToActivate;
|
|
}
|
|
}
|