Class ScreenHelper
java.lang.Object
com.pixelmonmod.pixelmon.client.gui.ScreenHelper
Helper methods for Pixelmon GUIs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected static final net.minecraft.resources.ResourceLocation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbindPokemonSprite(Pokemon pokemon, net.minecraft.client.Minecraft mc) static voidbindTexture(net.minecraft.resources.ResourceLocation resourceLocation) static voidCloses a GUI.static voidstatic voiddrawAttackInfoBox(net.minecraft.client.gui.GuiGraphics graphics, float zLevel, int width, int height) Draws a gray box to contain attack information.static voiddrawAttackInfoList(net.minecraft.client.gui.GuiGraphics graphics, Attack a, int width, int height) Draws information about an attack in a move list choose screen.static voiddrawAttackInfoMoveset(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 voiddrawBar(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, float percent, Color color) static voiddrawBar(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, float percent, Color color, boolean flip) static voiddrawBar(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 voiddrawBattleCursor(boolean draw, float x, float y, float z) static voiddrawBattleTimer(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.screens.Screen gui, int time) Draws the battle timer on the screen.static voiddrawCentered(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 voiddrawCentered(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 voiddrawCentered(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 voiddrawCenteredSplitString(net.minecraft.client.gui.GuiGraphics matrix, String text, float x, float y, int maxLength, int color) Draws text centered at a certain point.static voiddrawCenteredSplitString(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 voiddrawCenteredSplitString(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 voiddrawCenteredSplitString(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 voiddrawCenteredSquashedString(net.minecraft.client.gui.GuiGraphics graphics, String text, boolean unicode, double widthFactor, float x, float y, int color, boolean shadow) static voiddrawCenteredSquashedString(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 voiddrawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color) Draws text centered at a certain location.static voiddrawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow) static voiddrawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font fontRenderer, String text, float x, float y, int color) static voiddrawCenteredString(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 voiddrawCenteredString(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 voiddrawCenteredString(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 voiddrawCenteredString(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 voiddrawCenteredString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow) static voiddrawCenteredStringWithoutShadow(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 voiddrawCenteredStringWithoutShadow(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, int x, int y, int color) static voiddrawCircle(net.minecraft.client.gui.GuiGraphics matrix, double x, double y, double z, double d, int segments, Color color) static voiddrawDialogueBox(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 voiddrawDialogueBox(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 voiddrawDialogueBox(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 voiddrawEllipse(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double z, double w, double h, int segments, Color color) static voiddrawEntity(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 voiddrawGradientRect(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 voiddrawGradientRect(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 voiddrawGradientRect(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 voiddrawImage(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.resources.ResourceLocation texture, float x, float y, float width, float height, float zLevel) static voiddrawImage(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 voiddrawImage(net.minecraft.resources.ResourceLocation texture, net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float width, float height, float zLevel) static voiddrawImage(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 voiddrawImageQuad(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 voiddrawImageQuad(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 voiddrawImageQuad(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 voiddrawImageQuad(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 voiddrawImageQuadUV(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 voiddrawInNonUnicode(Runnable runnable) static voiddrawInUnicode(Runnable runnable) Forces the runnable to run after setting unicode font to enabled and then re-sets the unicode font afterstatic voiddrawItem(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.world.item.ItemStack stack, float x, float y, int srcFactor, int destFactor) static voiddrawItem(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.world.item.ItemStack stack, float x, float y, int srcFactor, int destFactor, boolean darken) static voiddrawLimitedSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int maxLength, int lines, int offset, int color) static voiddrawMoveset(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 voiddrawPokemonHoverInfo(net.minecraft.client.gui.GuiGraphics graphics, Pokemon pokemon, int x, int y) static voiddrawPokemonInfoChooseMove(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 voiddrawPolygon(net.minecraft.client.gui.GuiGraphics graphics, Point[] points, Point center, int color) static voiddrawQuad(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 voiddrawRectWithSemicircleEnds(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 voiddrawScaledCenteredSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, int maxLength) static voiddrawScaledCenteredSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, int maxLength, boolean dropShadow) static voiddrawScaledCenteredString(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 voiddrawScaledCenteredString(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 voiddrawScaledCenteredString(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 voiddrawScaledCenteredString(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 voiddrawScaledImage(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 voiddrawScaledSquashedString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, double widthFactor) Draws text that is scaled and squashedstatic voiddrawScaledSquashedString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize, double widthFactor, boolean unicode) static voiddrawScaledString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float fontSize) Draws text that is scaledstatic voiddrawScaledString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, float fontSize) Draws text that is scaledstatic voiddrawScaledStringRightAligned(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 voiddrawScaledStringWithOutline(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 charstatic voiddrawScoreboard(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 voiddrawSplitString(net.minecraft.client.gui.GuiGraphics graphics, String text, int x, int y, int maxLength, int color) static voiddrawSplitString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, int x, int y, int maxLength, int color) static voiddrawSquashedString(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 voiddrawSquashedString(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 voiddrawStar(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 voiddrawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color) Draws text at a certain location.static voiddrawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow) Draws text.static voiddrawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow, boolean unicode) static voiddrawString(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, float zLevel) static voiddrawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font, String text, float x, float y, int color) static voiddrawString(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 voiddrawString(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 voiddrawString(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 voiddrawString(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 voiddrawString(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 voiddrawString(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 voiddrawString(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 voiddrawString(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 voiddrawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, boolean dropShadow) Draws text.static voiddrawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.network.chat.Component text, float x, float y, int color, float zLevel) static voiddrawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.util.FormattedCharSequence text, float x, float y, int color) static voiddrawString(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.util.FormattedCharSequence text, float x, float y, int color, float zLevel) static voiddrawStringRightAligned(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color) Draws text that is aligned right.static voiddrawStringRightAligned(net.minecraft.client.gui.GuiGraphics graphics, String text, float x, float y, int color, boolean dropShadow) Draws text that is aligned right.static voiddrawStringRightAligned(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 voiddrawTaperedLine(net.minecraft.client.gui.GuiGraphics graphics, double x, double y, double width, double height, double taper, Color color) static voidstatic voidendSmoothDrawing(com.mojang.blaze3d.vertex.PoseStack matrix) static net.minecraft.client.gui.screens.Screenstatic PixelmonEntityFinds the evolving Pokémon entity in the world.static net.minecraft.client.gui.FontBinds a new font renderer that renders strings using the specified fontstatic StringgetLimitedString(String text, int maxLength) Cuts off text with ellipses if it exceeds a certain length.static intgetLongestStringWidth(Collection<String> lines) Finds the width of the longest string in a collection of strings.static intgetLongestWidth(Collection<net.minecraft.network.chat.Component> lines) Finds the width of the longest string in a collection of strings.static net.minecraft.resources.ResourceLocationgetPokemonSprite(Species species, String form, Gender gender, String palette, int eggCycles, net.minecraft.client.Minecraft mc) static net.minecraft.resources.ResourceLocationgetPokemonSprite(PixelmonClientData pokemon, net.minecraft.client.Minecraft mc) static intgetSplitLinesCount(String text, int maxLength) static intgetStringWidth(String text) static intgetStringWidth(String text, boolean unicode) static intgetStringWidth(net.minecraft.network.chat.Component text) static intgetStringWidth(net.minecraft.network.chat.Component text, boolean unicode) static booleanisKeyDown(int key) static voidprepareSmoothDrawing(com.mojang.blaze3d.vertex.PoseStack matrix) static StringremoveNewLine(String 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 voidrenderVignette(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 voidsetupOverlayRenderState(boolean blend, boolean depthTest) static voidsimpleDrawImageQuad(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 voidsimpleDrawImageQuad(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) splitString(String text, int maxLength) Splits a string by either a maximum length or a newline character.splitString(String text, int maxLength, boolean unicode) static StringsplitStringToFit(String s, int font, int width) Splits a string to as many lines needed in order to lower it's width to the specified amountstatic voidswitchFocus(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 voidswitchFocus(int keyInt, net.minecraft.client.gui.components.EditBox... textFields) Switches focus from one text field to the next sequentially when tab is pressed.static inttoColourValue(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.
-
Field Details
-
HALF_WIDTH_SPACE
- See Also:
-
VIGNETTE
protected static final net.minecraft.resources.ResourceLocation VIGNETTE
-
-
Constructor Details
-
ScreenHelper
public ScreenHelper()
-
-
Method Details
-
getFont
Binds a new font renderer that renders strings using the specified font- Parameters:
font- The resource location of the font to useextendedColours- 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
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
-
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 normaldropShadow- 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 normaldropShadow- 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 normaloutline- 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
Splits a string to as many lines needed in order to lower it's width to the specified amount- Parameters:
s- The input stringfont- 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
-
getPokemonSprite
public static net.minecraft.resources.ResourceLocation getPokemonSprite(PixelmonClientData pokemon, net.minecraft.client.Minecraft mc) -
getPokemonSprite
-
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
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
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
-
getStringWidth
-
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
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
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
-
removeNewLine
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
-
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
-
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
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- cyanm- magentay- yellow
-
setupOverlayRenderState
public static void setupOverlayRenderState(boolean blend, boolean depthTest)
-