Class RenderUtils

java.lang.Object
design.aeonic.nifty.api.client.RenderUtils

public final class RenderUtils extends Object
Messy class with some utility methods for rendering.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 stack
      x - the x position
      y - the y position
      zOffset - the z position (blit offset)
      width - the width
      height - the height
      fluidStack - the fluid stack
      fluidRenderInfo - the fluid render info (obtained from PlatformAccess.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.