Class ScreenHelper

java.lang.Object
com.pixelmonmod.pixelmon.client.gui.ScreenHelper

public class ScreenHelper extends Object
Helper methods for Pixelmon GUIs.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    protected static final net.minecraft.resources.ResourceLocation
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    bindPokemonSprite(Pokemon pokemon, net.minecraft.client.Minecraft mc)
     
    static void
    bindTexture(net.minecraft.resources.ResourceLocation resourceLocation)
     
    static void
    Closes a GUI.
    static void
     
    static void
    drawAttackInfoBox(net.minecraft.client.gui.GuiGraphics graphics, float zLevel, int width, int height)
    Draws a gray box to contain attack information.
    static void
    drawAttackInfoList(net.minecraft.client.gui.GuiGraphics graphics, Attack a, int width, int height)
    Draws information about an attack in a move list choose screen.
    static void
    drawAttackInfoMoveset(net.minecraft.client.gui.GuiGraphics graphics, Attack attack, int y, int width, int height)
    Draws information about the selected attack in a Pokémon's moveset.
    static void
    drawBar(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, float percent, Color color)
     
    static void
    drawBar(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, float percent, Color color, boolean flip)
     
    static void
    drawBar(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, float percent, Color color, Color incomplete, boolean flip)
    Draws a bar.
    static void
    drawBattleCursor(boolean draw, float x, float y, float z)
     
    static void
    drawBattleTimer(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.screens.Screen gui, int time)
    Draws the battle timer on the screen.
    static void
    drawCentered(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow)
    Draws text centered at a certain location.
    static void
    drawCentered(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, net.minecraft.util.FormattedCharSequence text, float x, float y, int color, boolean dropShadow)
    Draws text centered at a certain location.
    static void
    drawCentered(net.minecraft.client.gui.GuiGraphics matrix, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow)
    Draws text centered at a certain location.
    static void
    drawCenteredSplitString(net.minecraft.client.gui.GuiGraphics matrix, String text, float x, float y, int maxLength, int color)
    Draws text centered at a certain point.
    static void
    drawCenteredSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int maxLength, int color, boolean dropShadow)
    Draws text centered at a certain point.
    static void
    drawCenteredSplitString(net.minecraft.client.gui.GuiGraphics matrix, net.minecraft.network.chat.Component text, float x, float y, int maxLength, int color)
    Draws a styled, centered, and multi-line `Component` text at a given point.
    static void
    drawCenteredSplitString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int maxLength, int color, boolean dropShadow)
    Draws a styled, centered, and multi-line `Component` text at a given point.
    static void
    drawCenteredSquashedString(net.minecraft.client.gui.GuiGraphics graphics, String text, boolean unicode, double widthFactor, float x, float y, int color, boolean shadow)
     
    static void
    drawCenteredSquashedString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, boolean unicode, double widthFactor, float x, float y, int color, boolean shadow)
     
    static void
    drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color)
    Draws text centered at a certain location.
    static void
    drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow)
     
    static void
    drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, String text, float x, float y, int color)
     
    static void
    drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, String text, float x, float y, int color, boolean dropShadow)
    Draws text centered at a certain location.
    static void
    drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, String text, float x, float y, int color, int shadowColor)
    Draws text centered at a certain location with a specific shadow color.
    static void
    drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow)
     
    static void
    drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color)
    Draws text centered at a certain location.
    static void
    drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow)
     
    static void
    drawCenteredStringWithoutShadow(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int color)
    Draws a string at a certain position without any shadow.
    static void
    drawCenteredStringWithoutShadow(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, int x, int y, int color)
     
    static void
    drawCircle(net.minecraft.client.gui.GuiGraphics matrix, double x, double y, double z, double d, int segments, Color color)
     
    static void
    drawDialogueBox(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.screens.Screen screen, String name, String chatText, float zLevel)
    Draws a chat box with the dialogue of an NPC.
    static void
    drawDialogueBox(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.screens.Screen screen, String name, List<String> chatText, float zLevel)
    Draws a chat box with the dialogue of an NPC.
    static void
    drawDialogueBox(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.screens.Screen screen, net.minecraft.network.chat.Component name, net.minecraft.network.chat.Component chatText, float zLevel)
    Draws a chat box with the dialogue of an NPC.
    static void
    drawEllipse(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double z, double w, double h, int segments, Color color)
     
    static void
    drawEntity(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.world.entity.LivingEntity ent, int x, int y, float scale, float rotationYaw, float rotationPitch)
    Draws an entity in the GUI.
    static void
    drawGradientRect(net.minecraft.client.gui.GuiGraphics graphics, int left, int top, float zLevel, int right, int bottom, int startColour, int endColour)
    Draws a gradient rectangle from top to bottom.
    static void
    drawGradientRect(net.minecraft.client.gui.GuiGraphics graphics, int left, int top, float zLevel, int right, int bottom, int startColour, int endColour, boolean horizontal)
    Draws a gradient rectangle.
    static void
    drawGradientRect(net.minecraft.client.gui.GuiGraphics graphics, int left, int top, float zLevel, int right, int bottom, org.joml.Vector4f startColour, org.joml.Vector4f endColour, boolean horizontal)
    Draws a gradient rectangle.
    static void
    drawImage(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, float x, float y, float width, float height, float zLevel)
     
    static void
    drawImage(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, float x, float y, float width, float height, float r, float g, float b, float a, float zLevel)
     
    static void
    drawImage(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float width, float height, float zLevel)
     
    static void
    drawImage(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float width, float height, float r, float g, float b, float a, float zLevel)
     
    static void
    drawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, float zLevel)
    Draws an image that is bound to the renderer.
    static void
    drawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, float a, float zLevel)
     
    static void
    drawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, float r, float g, float b, float a, float zLevel)
     
    static void
    drawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, Color color, float zLevel)
     
    static void
    drawImageQuadUV(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float u, float v, float r, float g, float b, float a, float zLevel)
     
    static void
     
    static void
    Forces the runnable to run after setting unicode font to enabled and then re-sets the unicode font after
    static void
    drawItem(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.world.item.ItemStack stack, float x, float y, int srcFactor, int destFactor)
     
    static void
    drawItem(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.world.item.ItemStack stack, float x, float y, int srcFactor, int destFactor, boolean darken)
     
    static void
    drawLimitedSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int maxLength, int lines, int offset, int color)
     
    static void
    drawMoveset(net.minecraft.client.gui.GuiGraphics graphics, Moveset moveset, int width, int height, float zLevel)
    Draws a Pokémon's moveset on a move choosing screen.
    static void
    drawPokemonHoverInfo(net.minecraft.client.gui.GuiGraphics graphics, Pokemon pokemon, int x, int y)
     
    static void
    drawPokemonInfoChooseMove(net.minecraft.client.gui.GuiGraphics graphics, PixelmonClientData pokemon, int width, int height, float zLevel)
    Draws Pokémon information when choosing one of its moves.
    static void
    drawPolygon(net.minecraft.client.gui.GuiGraphics graphics, Point[] points, Point center, int color)
     
    static void
    drawQuad(net.minecraft.client.gui.GuiGraphics graphics, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, Color color)
     
    static void
    drawRectWithSemicircleEnds(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double z, double w, double h, int segments, Color color)
    Draws a coloured rect with semicircles attached to either end.
    static void
    drawScaledCenteredSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, int maxLength)
     
    static void
    drawScaledCenteredSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, int maxLength, boolean dropShadow)
     
    static void
    drawScaledCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize)
    Draws text that is centered and scaled 8)
    static void
    drawScaledCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, boolean dropShadow)
    Draws text that is centered and scaled 8)
    static void
    drawScaledCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, float fontSize)
    Draws text that is centered and scaled 8)
    static void
    drawScaledCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, float fontSize, boolean dropShadow)
    Draws text that is centered and scaled 8)
    static void
    drawScaledImage(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, float scale, float x, float y, float width, float height, float r, float g, float b, float a, float zLevel)
     
    static void
    drawScaledSquashedString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, double widthFactor)
    Draws text that is scaled and squashed
    static void
    drawScaledSquashedString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, double widthFactor, boolean unicode)
     
    static void
    drawScaledString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize)
    Draws text that is scaled
    static void
    drawScaledString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, float fontSize)
    Draws text that is scaled
    static void
    drawScaledStringRightAligned(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow, float fontSize)
    Draws text that is aligned right.
    static void
    drawScaledStringWithOutline(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, int outlineColor, float fontSize, float outline)
    Draws text that is scaled and has an outline on each char
    static void
    drawScoreboard(net.minecraft.client.gui.GuiGraphics graphics, int top, ScoreboardJustification justification, int x, int alpha, String title, Collection<String> lines, Collection<String> scores)
    Draws a scoreboard on the GUI.
    static void
    drawSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int maxLength, int color)
     
    static void
    drawSplitString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, int x, int y, int maxLength, int color)
     
    static void
    drawSquashedString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, boolean unicode, float widthFactor, float x, float y, int color, boolean shadow)
     
    static void
    drawSquashedString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, net.minecraft.network.chat.Component text, boolean unicode, float widthFactor, float x, float y, int color, boolean shadow)
     
    static void
    drawStar(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double z, double r1, double r2, int points, boolean outline, float r, float g, float b, float a)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color)
    Draws text at a certain location.
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow)
    Draws text.
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow, boolean unicode)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float zLevel)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, String text, float x, float y, int color)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, float x, float y, int color, boolean dropShadow)
    Draws text.
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, float x, float y, int color, boolean dropShadow, boolean unicode)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, float x, float y, int color, boolean dropShadow, boolean unicode, boolean centered)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, float x, float y, int color, boolean dropShadow, boolean unicode, float zLevel)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, net.minecraft.network.chat.Component text, float x, float y, int color)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow, boolean unicode)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow, boolean unicode, float zLevel)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color)
    Draws text at a certain location.
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow)
    Draws text.
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, float zLevel)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.util.FormattedCharSequence text, float x, float y, int color)
     
    static void
    drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.util.FormattedCharSequence text, float x, float y, int color, float zLevel)
     
    static void
    drawStringRightAligned(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color)
    Draws text that is aligned right.
    static void
    drawStringRightAligned(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow)
    Draws text that is aligned right.
    static void
    drawStringRightAligned(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow, boolean unicode)
    Draws text that is aligned right.
    static void
    drawTaperedLine(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, double taper, Color color)
     
    static void
     
    static void
    endSmoothDrawing(com.mojang.blaze3d.vertex.PoseStack matrix)
     
    static net.minecraft.client.gui.screens.Screen
     
    getEntity(UUID pokemonUUID)
    Finds the evolving Pokémon entity in the world.
    static net.minecraft.client.gui.Font
    getFont(String font, boolean extendedColours)
    Binds a new font renderer that renders strings using the specified font
    static String
    getLimitedString(String text, int maxLength)
    Cuts off text with ellipses if it exceeds a certain length.
    static int
    Finds the width of the longest string in a collection of strings.
    static int
    getLongestWidth(Collection<net.minecraft.network.chat.Component> lines)
    Finds the width of the longest string in a collection of strings.
    static net.minecraft.resources.ResourceLocation
    getPokemonSprite(Species species, String form, Gender gender, String palette, int eggCycles, net.minecraft.client.Minecraft mc)
     
    static net.minecraft.resources.ResourceLocation
    getPokemonSprite(PixelmonClientData pokemon, net.minecraft.client.Minecraft mc)
     
    static int
    getSplitLinesCount(String text, int maxLength)
     
    static int
     
    static int
    getStringWidth(String text, boolean unicode)
     
    static int
    getStringWidth(net.minecraft.network.chat.Component text)
     
    static int
    getStringWidth(net.minecraft.network.chat.Component text, boolean unicode)
     
    static boolean
    isKeyDown(int key)
     
    static void
    prepareSmoothDrawing(com.mojang.blaze3d.vertex.PoseStack matrix)
     
    static String
    Removes a trailing newline character from a string.
    static Optional<int[]>
    renderTooltip(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int gradient1, int background, int alpha, boolean centerBox, boolean centerText, String... tooltipData)
    Renders a tooltip on the screen.
    static Optional<int[]>
    renderTooltip(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, Collection<net.minecraft.network.chat.Component> tooltipData, int gradient1, int background, int alpha, boolean centerBox, boolean centerText)
    Renders a tooltip on the screen.
    static Optional<int[]>
    renderTooltip(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, Collection<net.minecraft.network.chat.Component> tooltipData, int gradient1, int background, int alpha, boolean centerBox, boolean centerText, float zLevel)
    Renders a tooltip on the screen.
    static void
    renderVignette(net.minecraft.client.gui.GuiGraphics graphics, int screenWidth, int screenHeight, float c, float m, float y)
    Render a vignette on the player's screen, as you would see near Minecraft's world border.
    static void
    setupOverlayRenderState(boolean blend, boolean depthTest)
     
    static void
    simpleDrawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, float zLevel)
    Simply draws an image that is bound to the renderer.
    static void
    simpleDrawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, float r, float g, float b, float a, float zLevel)
     
    static List<String>
    splitString(String text, int maxLength)
    Splits a string by either a maximum length or a newline character.
    static List<String>
    splitString(String text, int maxLength, boolean unicode)
     
    static String
    splitStringToFit(String s, int font, int width)
    Splits a string to as many lines needed in order to lower it's width to the specified amount
    static void
    switchFocus(int keyInt, List<net.minecraft.client.gui.components.EditBox> textFields)
    Switches focus from one text field to the next sequentially when tab is pressed.
    static void
    switchFocus(int keyInt, net.minecraft.client.gui.components.EditBox... textFields)
    Switches focus from one text field to the next sequentially when tab is pressed.
    static int
    toColourValue(float red, float green, float blue, float alpha)
    Converts RGBA color values from a 0-1 range into a single color value in a 0-255 range.
    static String[]
    trimStringToWidth(net.minecraft.client.gui.Font fr, String string, int width)
    Splits a string into multiple based on a width value given.

    Methods inherited from class java.lang.Object

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

    • HALF_WIDTH_SPACE

      public static final String HALF_WIDTH_SPACE
      See Also:
    • VIGNETTE

      protected static final net.minecraft.resources.ResourceLocation VIGNETTE
  • Constructor Details

    • ScreenHelper

      public ScreenHelper()
  • Method Details

    • getFont

      public static net.minecraft.client.gui.Font getFont(String font, boolean extendedColours)
      Binds a new font renderer that renders strings using the specified font
      Parameters:
      font - The resource location of the font to use
      extendedColours - Whether to use Pixelmon's extended colour font renderer or the vanilla font renderer
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow)
      Draws text.
      Parameters:
      graphics - The PoseStack context.
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      dropShadow - If the text has a shadow.
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow)
      Draws text.
      Parameters:
      graphics - The PoseStack context.
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      dropShadow - If the text has a shadow.
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, String text, float x, float y, int color)
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, net.minecraft.network.chat.Component text, float x, float y, int color)
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow, boolean unicode)
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, float x, float y, int color, boolean dropShadow)
      Draws text.
      Parameters:
      graphics - The PoseStack context.
      fr - The Font to use.
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      dropShadow - If the text has a shadow.
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, float x, float y, int color, boolean dropShadow, boolean unicode)
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, float x, float y, int color, boolean dropShadow, boolean unicode, float zLevel)
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow, boolean unicode, float zLevel)
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow, boolean unicode)
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, float x, float y, int color, boolean dropShadow, boolean unicode, boolean centered)
    • drawCenteredStringWithoutShadow

      public static void drawCenteredStringWithoutShadow(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int color)
      Draws a string at a certain position without any shadow.
      Parameters:
      text - The string to draw.
      x - The x coordinate of the center of the string.
      y - The y coordinate of the string.
      color - The color of the string.
    • drawCenteredStringWithoutShadow

      public static void drawCenteredStringWithoutShadow(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, int x, int y, int color)
    • drawInUnicode

      public static void drawInUnicode(Runnable runnable)
      Forces the runnable to run after setting unicode font to enabled and then re-sets the unicode font after
      Parameters:
      runnable - The executed code
    • drawInNonUnicode

      public static void drawInNonUnicode(Runnable runnable)
    • drawStringRightAligned

      public static void drawStringRightAligned(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color)
      Draws text that is aligned right.
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
    • drawStringRightAligned

      public static void drawStringRightAligned(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow)
      Draws text that is aligned right.
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      dropShadow - Whether to draw a shadow under the text.
    • drawStringRightAligned

      public static void drawStringRightAligned(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow, boolean unicode)
      Draws text that is aligned right.
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      dropShadow - Whether to draw a shadow under the text.
      unicode - Whether to use the Unicode font.
    • drawScaledString

      public static void drawScaledString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize)
      Draws text that is scaled
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      fontSize - The size of the text, 16 is normal
    • drawScaledString

      public static void drawScaledString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, float fontSize)
      Draws text that is scaled
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      fontSize - The size of the text, 16 is normal
    • drawScaledCenteredString

      public static void drawScaledCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize)
      Draws text that is centered and scaled 8)
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      fontSize - The size of the text, 16 is normal
    • drawScaledCenteredString

      public static void drawScaledCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, boolean dropShadow)
      Draws text that is centered and scaled 8)
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      fontSize - The size of the text, 16 is normal
      dropShadow - Whether to draw a drop shadow or not
    • drawScaledCenteredString

      public static void drawScaledCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, float fontSize, boolean dropShadow)
      Draws text that is centered and scaled 8)
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      fontSize - The size of the text, 16 is normal
      dropShadow - Whether to draw a drop shadow or not
    • drawScaledCenteredString

      public static void drawScaledCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, float fontSize)
      Draws text that is centered and scaled 8)
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      fontSize - The size of the text, 16 is normal
    • drawScaledStringWithOutline

      public static void drawScaledStringWithOutline(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, int outlineColor, float fontSize, float outline)
      Draws text that is scaled and has an outline on each char
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      fontSize - The size of the text, 16 is normal
      outline - Size of outline
    • drawScaledStringRightAligned

      public static void drawScaledStringRightAligned(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow, float fontSize)
      Draws text that is aligned right.
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      dropShadow - Whether to draw a shadow under the text.
    • splitStringToFit

      public static String splitStringToFit(String s, int font, int width)
      Splits a string to as many lines needed in order to lower it's width to the specified amount
      Parameters:
      s - The input string
      font - The font size of the string (16 is normal)
      width - The width that the string can not exceed
      Returns:
      The split string
    • simpleDrawImageQuad

      public static void simpleDrawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, float zLevel)
      Simply draws an image that is bound to the renderer. Do following things:

      1. Enable blending

      2. Set the shader texture and shader itself

      3. Create a buffer for rendering

      4. Define vertices with texture coordinates

      5. Draw the buffer with the shader

      6. Disable blending

      Parameters:
      x - The x coordinate of the left side of the image.
      y - The y coordinate of the top of the image.
      w - The width of the image.
      h - The height of the image.
      us - The horizontal component of the top-left corner of the texture.
      vs - The vertical component of the top-left corner of the texture.
      ue - The horizontal component of the bottom-right corner of the texture.
      ve - The vertical component of the bottom-right corner of the texture.
      zLevel - The z coordinate of the image.
    • simpleDrawImageQuad

      public static void simpleDrawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, float r, float g, float b, float a, float zLevel)
    • drawImageQuad

      public static void drawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, float zLevel)
      Draws an image that is bound to the renderer.
      Parameters:
      x - The x coordinate of the left side of the image.
      y - The y coordinate of the top of the image.
      w - The width of the image.
      h - The height of the image.
      us - The horizontal component of the top-left corner of the texture.
      vs - The vertical component of the top-left corner of the texture.
      ue - The horizontal component of the bottom-right corner of the texture.
      ve - The vertical component of the bottom-right corner of the texture.
      zLevel - The z coordinate of the image.
    • drawImageQuad

      public static void drawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, float a, float zLevel)
    • drawImageQuad

      public static void drawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, Color color, float zLevel)
    • drawImageQuad

      public static void drawImageQuad(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float ue, float ve, float r, float g, float b, float a, float zLevel)
    • drawImageQuadUV

      public static void drawImageQuadUV(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float w, float h, float us, float vs, float u, float v, float r, float g, float b, float a, float zLevel)
    • drawImage

      public static void drawImage(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float width, float height, float zLevel)
    • drawImage

      public static void drawImage(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, float x, float y, float width, float height, float zLevel)
    • drawImage

      public static void drawImage(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float width, float height, float r, float g, float b, float a, float zLevel)
    • drawImage

      public static void drawImage(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, float x, float y, float width, float height, float r, float g, float b, float a, float zLevel)
    • drawScaledImage

      public static void drawScaledImage(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, float scale, float x, float y, float width, float height, float r, float g, float b, float a, float zLevel)
    • drawSquashedString

      public static void drawSquashedString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, boolean unicode, float widthFactor, float x, float y, int color, boolean shadow)
    • drawSquashedString

      public static void drawSquashedString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, net.minecraft.network.chat.Component text, boolean unicode, float widthFactor, float x, float y, int color, boolean shadow)
    • drawCenteredSquashedString

      public static void drawCenteredSquashedString(net.minecraft.client.gui.GuiGraphics graphics, String text, boolean unicode, double widthFactor, float x, float y, int color, boolean shadow)
    • drawCenteredSquashedString

      public static void drawCenteredSquashedString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fr, String text, boolean unicode, double widthFactor, float x, float y, int color, boolean shadow)
    • bindPokemonSprite

      public static void bindPokemonSprite(Pokemon pokemon, net.minecraft.client.Minecraft mc)
    • getPokemonSprite

      public static net.minecraft.resources.ResourceLocation getPokemonSprite(PixelmonClientData pokemon, net.minecraft.client.Minecraft mc)
    • getPokemonSprite

      public static net.minecraft.resources.ResourceLocation getPokemonSprite(Species species, String form, Gender gender, String palette, int eggCycles, net.minecraft.client.Minecraft mc)
    • drawScoreboard

      public static void drawScoreboard(net.minecraft.client.gui.GuiGraphics graphics, int top, ScoreboardJustification justification, int x, int alpha, String title, Collection<String> lines, Collection<String> scores)
      Draws a scoreboard on the GUI.
      Parameters:
      top - The y coordinate of the top of the scoreboard.
      x - The x coordinate of the right side of the scoreboard.
      alpha - The alpha component of the scoreboard's color.
      title - The title text of the scoreboard.
      lines - The text to display on the scoreboard.
      scores - The scores to display on the scoreboard next to their corresponding lines.
    • getLongestStringWidth

      public static int getLongestStringWidth(Collection<String> lines)
      Finds the width of the longest string in a collection of strings.
      Parameters:
      lines - The collection of strings to get the longest width from.
      Returns:
      The width of the longest string in a collection of strings.
    • getLongestWidth

      public static int getLongestWidth(Collection<net.minecraft.network.chat.Component> lines)
      Finds the width of the longest string in a collection of strings.
      Parameters:
      lines - The collection of strings to get the longest width from.
      Returns:
      The width of the longest string in a collection of strings.
    • trimStringToWidth

      public static String[] trimStringToWidth(net.minecraft.client.gui.Font fr, String string, int width)
      Splits a string into multiple based on a width value given. Replacement for a vanilla method which no longer exists in a usable form.
      Parameters:
      fr - The Font to use.
      string - The string to split.
      width - The width to split on.
      Returns:
      Array of split strings.
    • renderTooltip

      public static Optional<int[]> renderTooltip(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int gradient1, int background, int alpha, boolean centerBox, boolean centerText, String... tooltipData)
      Renders a tooltip on the screen.
      Parameters:
      x - The x coordinate of the tooltip.
      y - The y coordinate of the tooltip.
      gradient1 - The color of the top of the tooltip.
      background - The color of the tooltip's background.
      alpha - The alpha value of the tooltip's background color.
      centerBox - Whether to center the tooltip around the x coordinate.
      centerText - Whether to center the text in the tooltip.
      tooltipData - The text to draw on the tooltip.
      Returns:
      The coordinates of left, top, right, bottom after rendering.
    • renderTooltip

      public static Optional<int[]> renderTooltip(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, Collection<net.minecraft.network.chat.Component> tooltipData, int gradient1, int background, int alpha, boolean centerBox, boolean centerText, float zLevel)
      Renders a tooltip on the screen.
      Parameters:
      x - The x coordinate of the tooltip.
      y - The y coordinate of the tooltip.
      tooltipData - The text to draw on the tooltip.
      gradient1 - The color of the top of the tooltip.
      background - The color of the tooltip's background.
      alpha - The alpha value of the tooltip's background color.
      centerBox - Whether to center the tooltip around the x coordinate.
      centerText - Whether to center the text in the tooltip.
      zLevel - The z pokemonLevel.
      Returns:
      The coordinates of left, top, right, bottom after rendering.
    • renderTooltip

      public static Optional<int[]> renderTooltip(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, Collection<net.minecraft.network.chat.Component> tooltipData, int gradient1, int background, int alpha, boolean centerBox, boolean centerText)
      Renders a tooltip on the screen.
      Parameters:
      x - The x coordinate of the tooltip.
      y - The y coordinate of the tooltip.
      tooltipData - The text to draw on the tooltip.
      gradient1 - The color of the top of the tooltip.
      background - The color of the tooltip's background.
      alpha - The alpha value of the tooltip's background color.
      centerBox - Whether to center the tooltip around the x coordinate.
      centerText - Whether to center the text in the tooltip.
      Returns:
      The coordinates of left, top, right, bottom after rendering.
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color)
      Draws text at a certain location.
      Parameters:
      text - The string to draw.
      x - The x coordinate of the start of the text.
      y - The y coordinate of the start of the text.
      color - The color of the text.
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color)
      Draws text at a certain location.
      Parameters:
      text - The string to draw.
      x - The x coordinate of the start of the text.
      y - The y coordinate of the start of the text.
      color - The color of the text.
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.util.FormattedCharSequence text, float x, float y, int color)
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float zLevel)
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, float zLevel)
    • drawString

      public static void drawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.util.FormattedCharSequence text, float x, float y, int color, float zLevel)
    • getStringWidth

      public static int getStringWidth(String text)
    • getStringWidth

      public static int getStringWidth(String text, boolean unicode)
    • getStringWidth

      public static int getStringWidth(net.minecraft.network.chat.Component text)
    • getStringWidth

      public static int getStringWidth(net.minecraft.network.chat.Component text, boolean unicode)
    • drawCenteredString

      public static void drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color)
      Draws text centered at a certain location.
      Parameters:
      text - The string to draw.
      x - The x coordinate of the center of the text.
      y - The y coordinate of the center of the text.
      color - The color of the text.
    • drawCenteredString

      public static void drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow)
    • drawCenteredString

      public static void drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, String text, float x, float y, int color)
    • drawCenteredString

      public static void drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow)
    • drawCenteredString

      public static void drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, String text, float x, float y, int color, boolean dropShadow)
      Draws text centered at a certain location.
      Parameters:
      text - The string to draw.
      x - The x coordinate of the center of the text.
      y - The y coordinate of the center of the text.
      color - The color of the text.
      dropShadow - Whether to apply shadow or not.
    • drawCenteredString

      public static void drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, String text, float x, float y, int color, int shadowColor)
      Draws text centered at a certain location with a specific shadow color.
      Parameters:
      text - The string to draw.
      x - The x coordinate of the center of the text.
      y - The y coordinate of the center of the text.
      color - The color of the text.
      shadowColor - The color of the shadow.
    • drawCenteredString

      public static void drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color)
      Draws text centered at a certain location.
      Parameters:
      text - The string to draw.
      x - The x coordinate of the center of the text.
      y - The y coordinate of the center of the text.
      color - The color of the text.
    • drawCenteredString

      public static void drawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow)
    • drawCentered

      public static void drawCentered(net.minecraft.client.gui.GuiGraphics matrix, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow)
      Draws text centered at a certain location.
      Parameters:
      text - The string to draw.
      x - The x coordinate of the center of the text.
      y - The y coordinate of the center of the text.
      color - The color of the text.
    • drawCentered

      public static void drawCentered(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow)
      Draws text centered at a certain location.
      Parameters:
      text - The string to draw.
      x - The x coordinate of the center of the text.
      y - The y coordinate of the center of the text.
      color - The color of the text.
    • drawCentered

      public static void drawCentered(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, net.minecraft.util.FormattedCharSequence text, float x, float y, int color, boolean dropShadow)
      Draws text centered at a certain location.
      Parameters:
      text - The string to draw.
      x - The x coordinate of the center of the text.
      y - The y coordinate of the center of the text.
      color - The color of the text.
      dropShadow - Whether the text should cast a shadow.
    • drawCenteredSplitString

      public static void drawCenteredSplitString(net.minecraft.client.gui.GuiGraphics matrix, String text, float x, float y, int maxLength, int color)
      Draws text centered at a certain point. Splits the text into multiple lines at spaces if it exceeds a certain length.
      Parameters:
      text - The text to draw.
      x - The x coordinate of the center of the text.
      y - The y coordinate of the center of the text.
      maxLength - The maximum length of the text.
      color - The color of the text.
    • drawCenteredSplitString

      public static void drawCenteredSplitString(net.minecraft.client.gui.GuiGraphics matrix, net.minecraft.network.chat.Component text, float x, float y, int maxLength, int color)
      Draws a styled, centered, and multi-line `Component` text at a given point. Automatically splits text into multiple lines if it exceeds the specified maximum length.
      Parameters:
      text - The `Component` to draw.
      x - The x coordinate of the text center.
      y - The y coordinate of the text center.
      maxLength - The maximum length of the text before splitting into multiple lines.
      color - The color of the text.
    • drawCenteredSplitString

      public static void drawCenteredSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int maxLength, int color, boolean dropShadow)
      Draws text centered at a certain point. Splits the text into multiple lines at spaces if it exceeds a certain length.
      Parameters:
      text - The text to draw.
      x - The x coordinate of the center of the text.
      y - The y coordinate of the center of the text.
      maxLength - The maximum length of the text.
      color - The color of the text.
      dropShadow - Whether the text should cast a shadow.
    • drawCenteredSplitString

      public static void drawCenteredSplitString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int maxLength, int color, boolean dropShadow)
      Draws a styled, centered, and multi-line `Component` text at a given point.
      Automatically splits text into multiple lines if it exceeds the specified maximum length.
      Parameters:
      graphics - The GUI graphics context for rendering.
      text - The `Component` to draw.
      x - The x coordinate of the text center.
      y - The y coordinate of the text center.
      maxLength - The maximum length of the text before splitting into multiple lines.
      color - The color of the text.
      dropShadow - Whether the text should cast a shadow.
    • getLimitedString

      public static String getLimitedString(String text, int maxLength)
      Cuts off text with ellipses if it exceeds a certain length.
      Parameters:
      text - The text to limit.
      maxLength - The maximum length of the text.
      Returns:
      The limited string.
    • splitString

      public static List<String> splitString(String text, int maxLength)
      Splits a string by either a maximum length or a newline character.
      Parameters:
      text - The text to split.
      maxLength - The maximum length of a line.
      Returns:
      The split string.
    • splitString

      public static List<String> splitString(String text, int maxLength, boolean unicode)
    • removeNewLine

      public static String removeNewLine(String string)
      Removes a trailing newline character from a string.
      Parameters:
      string - The string to modify.
      Returns:
      The given string with the trailing newline character removed.
    • drawGradientRect

      public static void drawGradientRect(net.minecraft.client.gui.GuiGraphics graphics, int left, int top, float zLevel, int right, int bottom, int startColour, int endColour)
      Draws a gradient rectangle from top to bottom.
      Parameters:
      left - The x coordinate of the left side of the rectangle.
      top - The y coordinate of the top of the rectangle.
      zLevel - The z coordinate of the rectangle.
      right - The x coordinate of the right side of the rectangle.
      bottom - The y coordinate of the bottom of the rectangle.
      startColour - The color of the top of the rectangle.
      endColour - The color of the bottom of the rectangle.
    • drawGradientRect

      public static void drawGradientRect(net.minecraft.client.gui.GuiGraphics graphics, int left, int top, float zLevel, int right, int bottom, int startColour, int endColour, boolean horizontal)
      Draws a gradient rectangle.
      Parameters:
      left - The x coordinate of the left side of the rectangle.
      top - The y coordinate of the top of the rectangle.
      zLevel - The z coordinate of the rectangle.
      right - The x coordinate of the right side of the rectangle.
      bottom - The y coordinate of the bottom of the rectangle.
      startColour - The color of the top of the rectangle.
      endColour - The color of the bottom of the rectangle.
      horizontal - True for left-to-right gradient, false for top-to-bottom gradient.
    • drawGradientRect

      public static void drawGradientRect(net.minecraft.client.gui.GuiGraphics graphics, int left, int top, float zLevel, int right, int bottom, org.joml.Vector4f startColour, org.joml.Vector4f endColour, boolean horizontal)
      Draws a gradient rectangle.
      Parameters:
      left - The x coordinate of the left side of the rectangle.
      top - The y coordinate of the top of the rectangle.
      zLevel - The z coordinate of the rectangle.
      right - The x coordinate of the right side of the rectangle.
      bottom - The y coordinate of the bottom of the rectangle.
      startColour - The color of the top of the rectangle.
      endColour - The color of the bottom of the rectangle.
      horizontal - True for left-to-right gradient, false for top-to-bottom gradient.
    • drawBar

      public static void drawBar(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, float percent, Color color)
    • drawBar

      public static void drawBar(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, float percent, Color color, boolean flip)
    • drawBar

      public static void drawBar(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, float percent, Color color, Color incomplete, boolean flip)
      Draws a bar.
      Parameters:
      x - The x coordinate of the bar.
      y - The y coordinate of the bar.
      width - The width of the bar.
      height - The height of the bar.
    • drawTaperedLine

      public static void drawTaperedLine(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, double taper, Color color)
    • drawRectWithSemicircleEnds

      public static void drawRectWithSemicircleEnds(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double z, double w, double h, int segments, Color color)
      Draws a coloured rect with semicircles attached to either end. The width of the rect does not account for the diameter of the semicircles, which is h / 2 each. This means your rect will be h longer than w.
      Parameters:
      x - The x coordinate of the rect.
      y - The y coordinate of the rect.
      z - The z pokemonLevel of the rect.
      w - The width of the rect.
      h - The height of the bar.
      segments - How many segments to use in the semicircles. More = higher detail, lower performance.
      color - The color of the rect.
    • drawCircle

      public static void drawCircle(net.minecraft.client.gui.GuiGraphics matrix, double x, double y, double z, double d, int segments, Color color)
    • drawEllipse

      public static void drawEllipse(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double z, double w, double h, int segments, Color color)
    • drawQuad

      public static void drawQuad(net.minecraft.client.gui.GuiGraphics graphics, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, Color color)
    • prepareSmoothDrawing

      public static void prepareSmoothDrawing(com.mojang.blaze3d.vertex.PoseStack matrix)
    • endSmoothDrawing

      public static void endSmoothDrawing(com.mojang.blaze3d.vertex.PoseStack matrix)
    • drawEntity

      public static void drawEntity(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.world.entity.LivingEntity ent, int x, int y, float scale, float rotationYaw, float rotationPitch)
      Draws an entity in the GUI.
      Parameters:
      ent - The entity to draw.
      x - The x coordinate to draw the entity at.
      y - The y coordinate to draw the entity at.
      scale - The scale of the entity.
      rotationYaw - The yaw of the entity.
      rotationPitch - The pitch of the entity.
    • drawPolygon

      public static void drawPolygon(net.minecraft.client.gui.GuiGraphics graphics, Point[] points, Point center, int color)
    • drawPokemonInfoChooseMove

      public static void drawPokemonInfoChooseMove(net.minecraft.client.gui.GuiGraphics graphics, PixelmonClientData pokemon, int width, int height, float zLevel)
      Draws Pokémon information when choosing one of its moves.
      Parameters:
      pokemon - The Pokémon to draw information for.
      width - The width of the screen.
      height - The height of the screen.
      zLevel - The z coordinate to draw text at.
    • closeScreen

      public static void closeScreen()
      Closes a GUI.
    • switchFocus

      public static void switchFocus(int keyInt, List<net.minecraft.client.gui.components.EditBox> textFields)
      Switches focus from one text field to the next sequentially when tab is pressed.
      Parameters:
      keyInt - The integer code of the key that was pressed.
      textFields - The text fields to consider when switching, in order.
    • switchFocus

      public static void switchFocus(int keyInt, net.minecraft.client.gui.components.EditBox... textFields)
      Switches focus from one text field to the next sequentially when tab is pressed.
      Parameters:
      keyInt - The integer code of the key that was pressed.
      textFields - The text fields to consider when switching, in order.
    • drawAttackInfoBox

      public static void drawAttackInfoBox(net.minecraft.client.gui.GuiGraphics graphics, float zLevel, int width, int height)
      Draws a gray box to contain attack information.
      Parameters:
      zLevel - The z coordinate of the box.
      width - The width of the screen.
      height - The height of the screen.
    • drawAttackInfoList

      public static void drawAttackInfoList(net.minecraft.client.gui.GuiGraphics graphics, Attack a, int width, int height)
      Draws information about an attack in a move list choose screen.
      Parameters:
      a - The attack to draw information about.
      width - The width of the screen.
      height - The height of the screen.
    • drawSplitString

      public static void drawSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int maxLength, int color)
    • drawLimitedSplitString

      public static void drawLimitedSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int maxLength, int lines, int offset, int color)
    • getSplitLinesCount

      public static int getSplitLinesCount(String text, int maxLength)
    • drawSplitString

      public static void drawSplitString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, int x, int y, int maxLength, int color)
    • drawAttackInfoMoveset

      public static void drawAttackInfoMoveset(net.minecraft.client.gui.GuiGraphics graphics, Attack attack, int y, int width, int height)
      Draws information about the selected attack in a Pokémon's moveset.
      Parameters:
      attack - The attack to draw info for.
      y - The y coordinate of the attack description text.
      width - The width of the screen.
      height - The height of the screen.
    • drawMoveset

      public static void drawMoveset(net.minecraft.client.gui.GuiGraphics graphics, Moveset moveset, int width, int height, float zLevel)
      Draws a Pokémon's moveset on a move choosing screen.
      Parameters:
      moveset - The Pokémon to draw a moveset for.
      width - The width of the screen.
      height - The height of the screen.
      zLevel - The z coordinate to draw text at.
    • toColourValue

      public static int toColourValue(float red, float green, float blue, float alpha)
      Converts RGBA color values from a 0-1 range into a single color value in a 0-255 range.
      Parameters:
      red - The red component of the color.
      green - The green component of the color.
      blue - The blue component of the color.
      alpha - The alpha component of the color.
      Returns:
      A consolidated color value with components in the 0-255 range.
    • getEntity

      public static PixelmonEntity getEntity(UUID pokemonUUID)
      Finds the evolving Pokémon entity in the world.
      Parameters:
      pokemonUUID - The UUID of the evolving Pokémon.
      Returns:
      The evolving Pokémon entity.
    • drawDialogueBox

      public static void drawDialogueBox(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.screens.Screen screen, String name, List<String> chatText, float zLevel)
      Draws a chat box with the dialogue of an NPC.
      Parameters:
      screen - The screen to draw the chat box on.
      name - The name of the NPC.
      chatText - The current dialogue of the NPC.
      zLevel - The z pokemonLevel of the screen.
    • drawDialogueBox

      public static void drawDialogueBox(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.screens.Screen screen, net.minecraft.network.chat.Component name, net.minecraft.network.chat.Component chatText, float zLevel)
      Draws a chat box with the dialogue of an NPC.
      Parameters:
      screen - The screen to draw the chat box on.
      name - The name of the NPC.
      chatText - The current dialogue of the NPC.
      zLevel - The z pokemonLevel of the screen.
    • drawDialogueBox

      public static void drawDialogueBox(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.screens.Screen screen, String name, String chatText, float zLevel)
      Draws a chat box with the dialogue of an NPC.
      Parameters:
      screen - The screen to draw the chat box on.
      name - The name of the NPC.
      chatText - The current dialogue of the NPC.
      zLevel - The z pokemonLevel of the screen.
    • drawBattleTimer

      public static void drawBattleTimer(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.screens.Screen gui, int time)
      Draws the battle timer on the screen.
      Parameters:
      gui - The screen to draw on.
      time - The current time on the timer.
    • drawPokemonHoverInfo

      public static void drawPokemonHoverInfo(net.minecraft.client.gui.GuiGraphics graphics, Pokemon pokemon, int x, int y)
    • drawScaledCenteredSplitString

      public static void drawScaledCenteredSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, int maxLength, boolean dropShadow)
    • drawScaledSquashedString

      public static void drawScaledSquashedString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, double widthFactor)
      Draws text that is scaled and squashed
      Parameters:
      text - The text to draw.
      x - The x coordinate of the right side of the text.
      y - The y coordinate of the text.
      color - The color of the text.
      fontSize - The size of the text, 16 is normal
    • drawScaledSquashedString

      public static void drawScaledSquashedString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, double widthFactor, boolean unicode)
    • drawScaledCenteredSplitString

      public static void drawScaledCenteredSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, int maxLength)
    • getCurrentScreen

      public static net.minecraft.client.gui.screens.Screen getCurrentScreen()
    • bindTexture

      public static void bindTexture(net.minecraft.resources.ResourceLocation resourceLocation)
    • isKeyDown

      public static boolean isKeyDown(int key)
    • drawBattleCursor

      public static void drawBattleCursor(boolean draw, float x, float y, float z)
    • drawStar

      public static void drawStar(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double z, double r1, double r2, int points, boolean outline, float r, float g, float b, float a)
    • disableMinecraftUI

      public static void disableMinecraftUI()
    • enableMinecraftUI

      public static void enableMinecraftUI()
    • drawItem

      public static void drawItem(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.world.item.ItemStack stack, float x, float y, int srcFactor, int destFactor)
    • drawItem

      public static void drawItem(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.world.item.ItemStack stack, float x, float y, int srcFactor, int destFactor, boolean darken)
    • renderVignette

      public static void renderVignette(net.minecraft.client.gui.GuiGraphics graphics, int screenWidth, int screenHeight, float c, float m, float y)
      Render a vignette on the player's screen, as you would see near Minecraft's world border. See how Minecraft does it here: Gui.renderVignette(GuiGraphics, Entity)
      Parameters:
      graphics - The graphics of the screen.
      screenWidth - The width of the Minecraft window.
      screenHeight - The height of the Minecraft window.
      c - cyan
      m - magenta
      y - yellow
    • setupOverlayRenderState

      public static void setupOverlayRenderState(boolean blend, boolean depthTest)