feat: some utils, but unfinished

This commit is contained in:
əlemi 2023-01-29 19:45:51 +01:00
parent 54a20617f8
commit b63303267d
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E
2 changed files with 31 additions and 0 deletions

View file

@ -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, );
}
}

View file

@ -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);
}
}