From b63303267dc0a75275dd65c31d122219cfb77283 Mon Sep 17 00:00:00 2001 From: alemidev Date: Sun, 29 Jan 2023 19:45:51 +0100 Subject: feat: some utils, but unfinished --- src/main/java/co/fantabos/bscv/tools/Text.java | 21 +++++++++++++++++++++ src/main/java/co/fantabos/bscv/tools/Utils.java | 10 ++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/main/java/co/fantabos/bscv/tools/Text.java create mode 100644 src/main/java/co/fantabos/bscv/tools/Utils.java (limited to 'src/main') 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 O coalesce(I val, Function f, Supplier fallback) { + return val == null ? fallback.get() : f.apply(val); + } +} -- cgit v1.2.3-56-ga3b1