All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.hendrixshen.magiclib.util.RenderUtil Maven / Gradle / Ivy

There is a newer version: 0.7.398+fe2125a-beta
Show newest version
package top.hendrixshen.magiclib.util;

import net.minecraft.class_2561;
import net.minecraft.class_310;
import net.minecraft.class_327;

public class RenderUtil {
    private static final class_327 TEXT_RENDERER = class_310.method_1551().field_1772;

    public static final int TEXT_HEIGHT = RenderUtil.TEXT_RENDERER.field_2000;
    public static final int TEXT_LINE_HEIGHT = RenderUtil.TEXT_HEIGHT + 1;

    public static int getRenderWidth(String text) {
        return RenderUtil.TEXT_RENDERER.method_1727(text);
    }

    public static int getRenderWidth(class_2561 text) {
        return RenderUtil.TEXT_RENDERER.widthCompat(text);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy