Package org.cyclops.cyclopscore.helper
Class GuiHelpers
java.lang.Object
org.cyclops.cyclopscore.helper.GuiHelpers
Deprecated.
Helpers related to guis.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDeprecated.Represents the direction of a progress bar. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intDeprecated.The default item slot size.static intDeprecated.The default inner item slot size. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddrawTooltip(net.minecraft.client.gui.screens.inventory.AbstractContainerScreen gui, com.mojang.blaze3d.vertex.PoseStack poseStack, List<net.minecraft.network.chat.Component> lines, int x, int y) Deprecated.Draw a tooltip.static voiddrawTooltipBackground(com.mojang.blaze3d.vertex.PoseStack poseStack, int xStart, int yStart, int tooltipWidth, int tooltipHeight) Deprecated.Draw the background box for a tooltip.static voidfillGradient(com.mojang.blaze3d.vertex.PoseStack poseStack, int left, int top, int right, int bottom, int startColor, int endColor, float zLevel) Deprecated.Render a rectangle.static StringquantityToScaledString(long quantity) Deprecated.Stringify a (potentially large) quantity to a scaled string.static voidrenderFluidSlot(net.minecraft.client.gui.GuiGraphics gui, net.neoforged.neoforge.fluids.FluidStack fluidStack, int x, int y) Deprecated.Render the given fluid in a standard slot.static voidrenderFluidTank(net.minecraft.client.gui.GuiGraphics gui, net.neoforged.neoforge.fluids.FluidStack fluidStack, int capacity, int x, int y, int width, int height) Deprecated.Render a fluid tank in a gui.static voidrenderOverlayedFluidTank(net.minecraft.client.gui.GuiGraphics gui, net.neoforged.neoforge.fluids.FluidStack fluidStack, int capacity, int x, int y, int width, int height, net.minecraft.resources.ResourceLocation textureOverlay, int overlayTextureX, int overlayTextureY) Deprecated.Render a fluid tank in a gui with a tank overlay.static voidrenderProgressBar(net.minecraft.client.gui.GuiGraphics gui, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, int textureX, int textureY, GuiHelpers.ProgressDirection direction, int progress, int progressMax) Deprecated.Render a progress bar in a certain direction.static voidrenderTooltip(net.minecraft.client.gui.screens.inventory.AbstractContainerScreen gui, com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, int mouseX, int mouseY, Supplier<List<net.minecraft.network.chat.Component>> linesSupplier) Deprecated.Render a tooltip if the mouse if in the bounding box defined by the given position, width and height.static voidrenderTooltipOptional(net.minecraft.client.gui.screens.inventory.AbstractContainerScreen gui, com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, int mouseX, int mouseY, Supplier<Optional<List<net.minecraft.network.chat.Component>>> linesSupplier) Deprecated.Render a tooltip if the mouse if in the bounding box defined by the given position, width and height.
-
Field Details
-
SLOT_SIZE
public static int SLOT_SIZEDeprecated.The default item slot size. Width and height are equal. -
SLOT_SIZE_INNER
public static int SLOT_SIZE_INNERDeprecated.The default inner item slot size. Width and height are equal.
-
-
Constructor Details
-
GuiHelpers
public GuiHelpers()Deprecated.
-
-
Method Details
-
renderFluidTank
public static void renderFluidTank(net.minecraft.client.gui.GuiGraphics gui, @Nullable net.neoforged.neoforge.fluids.FluidStack fluidStack, int capacity, int x, int y, int width, int height) Deprecated.Render a fluid tank in a gui.- Parameters:
gui- The gui to render in.fluidStack- The fluid to render.capacity- The tank capacity.x- The gui x position, including gui left.y- The gui y position, including gui top.width- The tank width.height- The tank height.
-
renderFluidSlot
public static void renderFluidSlot(net.minecraft.client.gui.GuiGraphics gui, @Nullable net.neoforged.neoforge.fluids.FluidStack fluidStack, int x, int y) Deprecated.Render the given fluid in a standard slot.- Parameters:
gui- The gui to render in.fluidStack- The fluid to render.x- The slot X position.y- The slot Y position.
-
renderOverlayedFluidTank
public static void renderOverlayedFluidTank(net.minecraft.client.gui.GuiGraphics gui, @Nullable net.neoforged.neoforge.fluids.FluidStack fluidStack, int capacity, int x, int y, int width, int height, net.minecraft.resources.ResourceLocation textureOverlay, int overlayTextureX, int overlayTextureY) Deprecated.Render a fluid tank in a gui with a tank overlay. This assumes that the tank overlay has the provided width and height.- Parameters:
gui- The gui to render in.fluidStack- The fluid to render.capacity- The tank capacity.x- The gui x position, including gui left.y- The gui y position, including gui top.width- The tank width.height- The tank height.textureOverlay- The texture of the tank overlay.overlayTextureX- The overlay x texture position.overlayTextureY- The overlay y texture position.
-
renderProgressBar
public static void renderProgressBar(net.minecraft.client.gui.GuiGraphics gui, net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, int textureX, int textureY, GuiHelpers.ProgressDirection direction, int progress, int progressMax) Deprecated.Render a progress bar in a certain direction. The currently bound texture will be used to render the progress bar.- Parameters:
gui- The gui to render in.texture- The texture.x- The gui x position, including gui left.y- The gui y position, including gui top.width- The progress bar width.height- The progress bar height.textureX- The texture x position.textureY- The texture y position.direction- The direction to progress in.progress- The current progress.progressMax- The maximum progress.
-
drawTooltip
public static void drawTooltip(net.minecraft.client.gui.screens.inventory.AbstractContainerScreen gui, com.mojang.blaze3d.vertex.PoseStack poseStack, List<net.minecraft.network.chat.Component> lines, int x, int y) Deprecated.Draw a tooltip.- Parameters:
gui- The gui to draw in.poseStack- The pose stack.lines- A list of lines.x- Tooltip X.y- Tooltip Y.
-
drawTooltipBackground
public static void drawTooltipBackground(com.mojang.blaze3d.vertex.PoseStack poseStack, int xStart, int yStart, int tooltipWidth, int tooltipHeight) Deprecated.Draw the background box for a tooltip.- Parameters:
poseStack- The pose stack.xStart- XyStart- YtooltipWidth- WidthtooltipHeight- Height
-
fillGradient
public static void fillGradient(com.mojang.blaze3d.vertex.PoseStack poseStack, int left, int top, int right, int bottom, int startColor, int endColor, float zLevel) Deprecated.Render a rectangle. Public variant of GuiGraphics#fillGradient.- Parameters:
poseStack- The pose stack.left- Left X.top- Top Y.right- Right X.bottom- Bottom Y.startColor- Start gradient color.endColor- End gradient color.zLevel- The Z level to render at.
-
renderTooltipOptional
public static void renderTooltipOptional(net.minecraft.client.gui.screens.inventory.AbstractContainerScreen gui, com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, int mouseX, int mouseY, Supplier<Optional<List<net.minecraft.network.chat.Component>>> linesSupplier) Deprecated.Render a tooltip if the mouse if in the bounding box defined by the given position, width and height. The tooltip lines supplier can return an optional list.- Parameters:
gui- The gui to render in.poseStack- The pose stack.x- The gui x position, excluding gui left.y- The gui y position, excluding gui top.width- The area width.height- The area height.mouseX- The mouse x position.mouseY- The mouse y position.linesSupplier- A supplier for the optional tooltip lines to render. No tooltip will be rendered when the optional value is absent. This will only be called when needed.
-
renderTooltip
public static void renderTooltip(net.minecraft.client.gui.screens.inventory.AbstractContainerScreen gui, com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, int mouseX, int mouseY, Supplier<List<net.minecraft.network.chat.Component>> linesSupplier) Deprecated.Render a tooltip if the mouse if in the bounding box defined by the given position, width and height.- Parameters:
gui- The gui to render in.poseStack- The pose stack.x- The gui x position, excluding gui left.y- The gui y position, excluding gui top.width- The area width.height- The area height.mouseX- The mouse x position.mouseY- The mouse y position.linesSupplier- A supplier for the tooltip lines to render. This will only be called when needed.
-
quantityToScaledString
Deprecated.Stringify a (potentially large) quantity to a scaled string. For example, 123765 will be converted as 1.23M.- Parameters:
quantity- A quantity.- Returns:
- A scaled quantity string.
-