feat: some utils, but unfinished
This commit is contained in:
parent
54a20617f8
commit
b63303267d
2 changed files with 31 additions and 0 deletions
21
src/main/java/co/fantabos/bscv/tools/Text.java
Normal file
21
src/main/java/co/fantabos/bscv/tools/Text.java
Normal 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, );
|
||||
}
|
||||
}
|
10
src/main/java/co/fantabos/bscv/tools/Utils.java
Normal file
10
src/main/java/co/fantabos/bscv/tools/Utils.java
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue