aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/config
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-05-14 00:59:25 -0700
committerGitHub <noreply@github.com>2022-05-14 09:59:25 +0200
commit2c592090b9448203559e01326bc2c2d995b15d53 (patch)
tree821d347aefc828c214d817c8b7be8cf3c0b0ea9f /src/main/java/cc/polyfrost/oneconfig/config
parent4b8f98aa1435817c13e7083e30896ef8b5cbdaf0 (diff)
downloadOneConfig-2c592090b9448203559e01326bc2c2d995b15d53.tar.gz
OneConfig-2c592090b9448203559e01326bc2c2d995b15d53.tar.bz2
OneConfig-2c592090b9448203559e01326bc2c2d995b15d53.zip
de-minecraftify a lot of things + use mixin instead of reflection (#11)
* de-minecraftify * use mixin instead of reflection * lol
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/config')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/core/OneKeyBind.java9
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/interfaces/Config.java3
2 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/core/OneKeyBind.java b/src/main/java/cc/polyfrost/oneconfig/config/core/OneKeyBind.java
index f39e1c7..d455411 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/core/OneKeyBind.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/core/OneKeyBind.java
@@ -1,9 +1,6 @@
package cc.polyfrost.oneconfig.config.core;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-import net.minecraftforge.fml.common.gameevent.InputEvent;
-import org.lwjgl.input.Keyboard;
+import gg.essential.universal.UKeyboard;
import java.util.ArrayList;
@@ -19,7 +16,7 @@ public class OneKeyBind {
public boolean isActive() {
if (keyBinds.size() == 0) return false;
for (int keyBind : keyBinds) {
- if (!Keyboard.isKeyDown(keyBind)) return false;
+ if (!UKeyboard.isKeyDown(keyBind)) return false;
}
return true;
}
@@ -28,7 +25,7 @@ public class OneKeyBind {
StringBuilder sb = new StringBuilder();
for (int keyBind : keyBinds) {
if (sb.length() != 0) sb.append(" + ");
- sb.append(Keyboard.getKeyName(keyBind));
+ sb.append(UKeyboard.getKeyName(keyBind, -1));
}
return sb.toString().trim();
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/interfaces/Config.java b/src/main/java/cc/polyfrost/oneconfig/config/interfaces/Config.java
index cbd4b08..a11b1d2 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/interfaces/Config.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/interfaces/Config.java
@@ -12,6 +12,7 @@ import cc.polyfrost.oneconfig.hud.BasicHud;
import cc.polyfrost.oneconfig.hud.HudCore;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import com.google.gson.*;
+import gg.essential.universal.UScreen;
import java.io.*;
import java.lang.reflect.Field;
@@ -230,7 +231,7 @@ public class Config {
*/
public void openGui() {
if (mod == null) return;
- RenderManager.displayGuiScreen(new OneConfigGui(new ModConfigPage(mod.defaultPage)));
+ UScreen.displayScreen(new OneConfigGui(new ModConfigPage(mod.defaultPage)));
}
/**