Class Ukutils

java.lang.Object
net.uku3lig.ukulib.utils.Ukutils

public class Ukutils extends Object
Simple class for various utilities.
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.client.gui.widget.ButtonWidget
    doneButton(int width, int height, net.minecraft.client.gui.screen.Screen parent)
    Creates a done button.
    static String
    getText(net.minecraft.text.OrderedText text)
    Retrieves the string text from an ordered text.
    static org.joml.Vector2ic
    getTextCoords(net.minecraft.text.Text text, int screenWidth, net.minecraft.client.font.TextRenderer textRenderer, int x, int y)
    Makes text coordinates based on the position of a standard 16x16 icon.
    static org.joml.Vector2ic
    getTextCoords(net.minecraft.text.Text text, int screenWidth, net.minecraft.client.font.TextRenderer textRenderer, int x, int y, int width, int height)
    Makes text coordinates based on the position of an icon.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • doneButton

      public static net.minecraft.client.gui.widget.ButtonWidget doneButton(int width, int height, net.minecraft.client.gui.screen.Screen parent)
      Creates a done button.
      Parameters:
      width - The width of the screen
      height - The height of the screen
      parent - The parent screen
      Returns:
      The generated button
    • getTextCoords

      public static org.joml.Vector2ic getTextCoords(net.minecraft.text.Text text, int screenWidth, net.minecraft.client.font.TextRenderer textRenderer, int x, int y, int width, int height)
      Makes text coordinates based on the position of an icon.
      Parameters:
      text - The text to be drawn
      screenWidth - The width of the screen
      textRenderer - The text renderer
      x - The x coordinate of the icon
      y - The y coordinate of the icon
      width - The width of the icon
      height - The height of the icon
      Returns:
      The tuple of coordinates
    • getTextCoords

      public static org.joml.Vector2ic getTextCoords(net.minecraft.text.Text text, int screenWidth, net.minecraft.client.font.TextRenderer textRenderer, int x, int y)
      Makes text coordinates based on the position of a standard 16x16 icon.
      Parameters:
      text - The text to be drawn
      screenWidth - The width of the screen
      textRenderer - The text renderer
      x - The x coordinate of the icon
      y - The y coordinate of the icon
      Returns:
      The tuple of coordinates
      See Also:
    • getText

      public static String getText(net.minecraft.text.OrderedText text)
      Retrieves the string text from an ordered text.
      Parameters:
      text - The ordered text
      Returns:
      The value of the text