summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
author alemidev <me@alemi.dev>2023-01-29 19:45:51 +0100
committer alemidev <me@alemi.dev>2023-01-29 19:45:51 +0100
commitb63303267dc0a75275dd65c31d122219cfb77283 (patch)
tree0453d2129ed35b3e6a745f291177464188d5d293 /src/main
parent54a20617f812cf46ac4e11fe583bd06879ef3f5d (diff)
feat: some utils, but unfinished
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/co/fantabos/bscv/tools/Text.java21
-rw-r--r--src/main/java/co/fantabos/bscv/tools/Utils.java10
2 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/co/fantabos/bscv/tools/Text.java b/src/main/java/co/fantabos/bscv/tools/Text.java
new file mode 100644
index 0000000..b5ae83b
--- /dev/null
+++ b/src/main/java/co/fantabos/bscv/tools/Text.java
@@ -0,0 +1,21 @@
+package co.fantabos.bscv.tools;
+
+import com.mojang.blaze3d.matrix.MatrixStack;
+
+import co.fantabos.bscv.BoSCoVicino;
+import net.minecraft.client.gui.FontRenderer;
+
+public final class Text {
+ final String text;
+
+ public Text(String text) {
+ this.text = text;
+ }
+
+
+
+ public void render(MatrixStack stack) {
+ FontRenderer font = BoSCoVicino.minecraft.font;
+ font.drawShadow(stack, );
+ }
+}
diff --git a/src/main/java/co/fantabos/bscv/tools/Utils.java b/src/main/java/co/fantabos/bscv/tools/Utils.java
new file mode 100644
index 0000000..07d8355
--- /dev/null
+++ b/src/main/java/co/fantabos/bscv/tools/Utils.java
@@ -0,0 +1,10 @@
+package co.fantabos.bscv.tools;
+
+import java.util.function.Function;
+import java.util.function.Supplier;
+
+public class Utils {
+ public static <I, O> O coalesce(I val, Function<I, O> f, Supplier<O> fallback) {
+ return val == null ? fallback.get() : f.apply(val);
+ }
+}