aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/test
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-27 03:54:28 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-27 03:54:28 +0700
commit9afbfbc4c41bf8f90b5de901797e18375da2c01a (patch)
tree125282f723f1e17a8a077c0a3222f777fd74ca06 /src/main/java/cc/polyfrost/oneconfig/test
parentf6bebfc3d14812dfac4592c1b35becf83d46cf76 (diff)
downloadOneConfig-9afbfbc4c41bf8f90b5de901797e18375da2c01a.tar.gz
OneConfig-9afbfbc4c41bf8f90b5de901797e18375da2c01a.tar.bz2
OneConfig-9afbfbc4c41bf8f90b5de901797e18375da2c01a.zip
cache text
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/test')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java8
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java14
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/test/TestMultilineHud_Test.java18
3 files changed, 30 insertions, 10 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java b/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java
index 2f4960e..4acd533 100644
--- a/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java
+++ b/src/main/java/cc/polyfrost/oneconfig/test/TestConfig_Test.java
@@ -117,7 +117,13 @@ public class TestConfig_Test extends Config {
name = "Test HUD",
category = "HUD"
)
- public TestHud_Test hud = new TestHud_Test(false, 0, 0);
+ public TestHud_Test hud = new TestHud_Test();
+
+ @HUD(
+ name = "Test Multiline HUD",
+ category = "HUD"
+ )
+ public TestMultilineHud_Test multilineHud = new TestMultilineHud_Test();
public TestConfig_Test() {
super(new Mod("Test Mod", ModType.UTIL_QOL, new VigilanceMigrator("./config/testConfig.toml")), "hacksConfig.json");
diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java b/src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java
index 9982e7d..d62f664 100644
--- a/src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java
+++ b/src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java
@@ -2,25 +2,21 @@ package cc.polyfrost.oneconfig.test;
import cc.polyfrost.oneconfig.config.annotations.Switch;
import cc.polyfrost.oneconfig.hud.SingleTextHud;
-import net.minecraft.client.Minecraft;
public class TestHud_Test extends SingleTextHud {
+ int times = 0;
@Switch(
name = "Custom Option"
)
public boolean yes;
- public TestHud_Test(boolean enabled, int x, int y) {
- super(enabled, x, y);
- }
-
- @Override
- public String getDefaultTitle() {
- return "FPS";
+ public TestHud_Test() {
+ super("Time");
}
@Override
public String getText() {
- return Integer.toString(Minecraft.getDebugFPS());
+ times++;
+ return String.valueOf(times);
}
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestMultilineHud_Test.java b/src/main/java/cc/polyfrost/oneconfig/test/TestMultilineHud_Test.java
new file mode 100644
index 0000000..d3bad28
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/test/TestMultilineHud_Test.java
@@ -0,0 +1,18 @@
+package cc.polyfrost.oneconfig.test;
+
+import cc.polyfrost.oneconfig.hud.MultiTextHud;
+import com.google.common.collect.Lists;
+import net.minecraft.client.Minecraft;
+
+import java.util.List;
+
+public class TestMultilineHud_Test extends MultiTextHud {
+ public TestMultilineHud_Test() {
+ super(true);
+ }
+
+ @Override
+ public List<String> getLines() {
+ return Lists.newArrayList(String.valueOf(System.currentTimeMillis()), String.valueOf(Minecraft.getSystemTime()));
+ }
+}