Package design.aeonic.nifty.api.client
Class RenderUtils
java.lang.Object
design.aeonic.nifty.api.client.RenderUtils
Messy class with some utility methods for rendering.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
angleGradient
(com.mojang.blaze3d.vertex.PoseStack stack, int x1, int y1, int x2, int y2, int z, int fromRGBA, int toRGBA) static void
angleGradient
(com.mojang.math.Matrix4f pose, com.mojang.blaze3d.vertex.BufferBuilder builder, int x1, int y1, int x2, int y2, int z, int fromRGBA, int toRGBA) static void
drawFluidBlock
(com.mojang.blaze3d.vertex.PoseStack stack, net.minecraft.world.level.material.FluidState fluidState, FluidRenderInfo fluidInfo, float height) Renders a fluid block with the given state (though it ignores the level - use the height parameter instead).static void
drawRect
(com.mojang.blaze3d.vertex.PoseStack stack, Texture texture, int x, int y, int zOffset, int width, int height) static void
drawRect
(com.mojang.blaze3d.vertex.PoseStack stack, Texture texture, int x, int y, int zOffset, int width, int height, int color) Draws a rectangle with the given texture tiled to fit the dimensions.static void
drawScreenFluid
(com.mojang.blaze3d.vertex.PoseStack stack, int x, int y, int zOffset, int width, int height, FluidStack fluidStack, FluidRenderInfo fluidRenderInfo) Draws a fluid stack to the screen, intended for use in a GUI.static void
unpackRGB
(int color, float[] rgb) static void
unpackRGBA
(int color, float[] rgba)
-
Constructor Details
-
RenderUtils
public RenderUtils()
-
-
Method Details
-
drawFluidBlock
public static void drawFluidBlock(com.mojang.blaze3d.vertex.PoseStack stack, net.minecraft.world.level.material.FluidState fluidState, FluidRenderInfo fluidInfo, float height) Renders a fluid block with the given state (though it ignores the level - use the height parameter instead). -
drawScreenFluid
public static void drawScreenFluid(com.mojang.blaze3d.vertex.PoseStack stack, int x, int y, int zOffset, int width, int height, FluidStack fluidStack, FluidRenderInfo fluidRenderInfo) Draws a fluid stack to the screen, intended for use in a GUI.- Parameters:
stack
- the pose stackx
- the x positiony
- the y positionzOffset
- the z position (blit offset)width
- the widthheight
- the heightfluidStack
- the fluid stackfluidRenderInfo
- the fluid render info (obtained fromPlatformAccess.getFluidRenderInfo(Fluid)
-
angleGradient
public static void angleGradient(com.mojang.blaze3d.vertex.PoseStack stack, int x1, int y1, int x2, int y2, int z, int fromRGBA, int toRGBA) -
angleGradient
public static void angleGradient(com.mojang.math.Matrix4f pose, com.mojang.blaze3d.vertex.BufferBuilder builder, int x1, int y1, int x2, int y2, int z, int fromRGBA, int toRGBA) -
unpackRGB
public static void unpackRGB(int color, float[] rgb) -
unpackRGBA
public static void unpackRGBA(int color, float[] rgba) -
drawRect
public static void drawRect(com.mojang.blaze3d.vertex.PoseStack stack, Texture texture, int x, int y, int zOffset, int width, int height) -
drawRect
public static void drawRect(com.mojang.blaze3d.vertex.PoseStack stack, Texture texture, int x, int y, int zOffset, int width, int height, int color) Draws a rectangle with the given texture tiled to fit the dimensions. Ex: nodes, which use a 16x16 texture. See the `textures/gui/graph/node.png` file for an example.
-