From 8fe58141d22fa35a27786c9475d4447563a9e85e Mon Sep 17 00:00:00 2001 From: winterflyt <36+winterflyt@noreply.skidsolutions.xyz> Date: Mon, 30 Nov 2026 06:02:14 +0200 Subject: [PATCH] Upload files to "src/openonyx/input" --- src/openonyx/input/CharInput.java | 40 ++++++++++++++ src/openonyx/input/KeyInput.java | 61 +++++++++++++++++++++ src/openonyx/input/KeyStateTracker.java | 71 +++++++++++++++++++++++++ src/openonyx/input/MouseInput.java | 35 ++++++++++++ 4 files changed, 207 insertions(+) create mode 100644 src/openonyx/input/CharInput.java create mode 100644 src/openonyx/input/KeyInput.java create mode 100644 src/openonyx/input/KeyStateTracker.java create mode 100644 src/openonyx/input/MouseInput.java diff --git a/src/openonyx/input/CharInput.java b/src/openonyx/input/CharInput.java new file mode 100644 index 0000000..d11fe5d --- /dev/null +++ b/src/openonyx/input/CharInput.java @@ -0,0 +1,40 @@ +package openonyx.input; + +public record CharInput(int codepoint, int modifiers) { + public CharInput(char c) { + this(c, 0); + } + + public static String decrypt(String string) { + String string1 = string; + int p = (--3 ^ 5) << 4 ^ 10; + int q = 4 << 4 ^ 6; + String string2; + int r = (string2 = string1).length(); + char[] e = new char[r]; + boolean bl = true; + int k; + int n = k = r - 1; + char[] c = e; + int j = q; + int o = 58; + int l = n; + int i = p; + + while (l >= 0) { + int m = k; + char d = string2.charAt(k); + k--; + c[m] = (char)(d ^ i); + if (k < 0) { + break; + } + + o = k--; + c[o] = (char)(string2.charAt(o) ^ j); + l = k; + } + + return new String(c); + } +} diff --git a/src/openonyx/input/KeyInput.java b/src/openonyx/input/KeyInput.java new file mode 100644 index 0000000..0bfa9a2 --- /dev/null +++ b/src/openonyx/input/KeyInput.java @@ -0,0 +1,61 @@ +package openonyx.input; + +import net.minecraft.client.gui.GuiScreen; + +public record KeyInput(int key, int scancode, int modifiers, char typedChar) { + public boolean i() { + return this.D(); + } + + public boolean D() { + return GuiScreen.isCtrlKeyDown() && GuiScreen.isCtrlCharTyped(this.typedChar); + } + + public boolean d() { + return GuiScreen.isShiftKeyDown(); + } + + public boolean L() { + return GuiScreen.isAltKeyDown(); + } + + public static String decrypt(String string) { + String string1 = string; + int l = 5 >> 1 << 3 ^ 4; + int m = 4 << 4 ^ 2 << 2 ^ 1; + String string2; + int o = (string2 = string1).length(); + char[] d = new char[o]; + boolean bl = true; + int j; + int n = j = o - 1; + char[] c = d; + byte b = 41; + l = n; + int i = m; + + while (l >= 0) { + m = j; + int k = string2.charAt(j); + j--; + c[m] = (char)(k ^ i); + if (j < 0) { + break; + } + + k = j--; + c[k] = (char)(string2.charAt(k) ^ b); + l = j; + } + + return new String(c); + } + + public KeyInput(int i) { + this(i, 0, 0, '\u0000'); + } + + public KeyInput(int i, int j, int k) { + this(i, j, k, '\u0000'); + } +} diff --git a/src/openonyx/input/KeyStateTracker.java b/src/openonyx/input/KeyStateTracker.java new file mode 100644 index 0000000..c58aa51 --- /dev/null +++ b/src/openonyx/input/KeyStateTracker.java @@ -0,0 +1,71 @@ +package openonyx.input; + +import java.util.Arrays; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.Display; + +public final class KeyStateTracker { + private static final boolean[] H; + private static boolean e = true; + + private KeyStateTracker() { + } + + private static boolean L(int i, int j) { + return L(i) || L(j); + } + + private static boolean L(int i) { + if (!H[i]) { + return false; + } + + if (Keyboard.isKeyDown(i)) { + return true; + } + + H[i] = false; + return false; + } + + public static boolean i() { + return L(42, 54); + } + + public static void d() { + Arrays.fill(H, false); + } + + public static boolean D() { + return L(29, 157); + } + + public static void L() { + boolean bl; + if (!(bl = Display.isActive()) || !e) { + d(); + } + + e = bl; + } + + public static boolean d() { + return L(56, 184); + } + + public static boolean L() { + return L(219, 220); + } + + public static void L(int i, boolean bl) { + if (i > 0 && i < H.length) { + H[i] = bl; + } + } + + static { + boolean[] bl = new boolean[256]; + boolean bl1 = true; + H = bl; + } +} diff --git a/src/openonyx/input/MouseInput.java b/src/openonyx/input/MouseInput.java new file mode 100644 index 0000000..f789714 --- /dev/null +++ b/src/openonyx/input/MouseInput.java @@ -0,0 +1,35 @@ +package openonyx.input; + +public record MouseInput(double x, double y, int button) { + public static String decrypt(String string) { + String string1 = string; + int n = (--3 ^ 5) << 4 ^ 14; + String string2; + int p = (string2 = string1).length(); + char[] e = new char[p]; + boolean bl = true; + int j; + int o = j = p - 1; + char[] c = e; + byte b = 43; + byte d = 40; + int k = o; + int i = n; + + while (k >= 0) { + int l = j; + int m = string2.charAt(j); + j--; + c[l] = (char)(m ^ i); + if (j < 0) { + break; + } + + m = j--; + c[m] = (char)(string2.charAt(m) ^ b); + k = j; + } + + return new String(c); + } +}