Class FluidVolumeRenderer

java.lang.Object
alexiil.mc.lib.attributes.fluid.render.FluidVolumeRenderer
Direct Known Subclasses:
DefaultFluidVolumeRenderer, EnchantmentGlintFluidRenderer, ImplicitVanillaFluidVolumeRenderer

public abstract class FluidVolumeRenderer
extends java.lang.Object
Helper class for rendering FluidVolume instances. Block, Entity, and Screen renders should never call instances of this class directly. Instead they should always use FluidVolume.getRenderer().
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  FluidVolumeRenderer.ComponentRenderFaces  
    static class  FluidVolumeRenderer.ExpandingVcp
    A simple, auto-expanding VertexConsumerProvider that can render any number of RenderLayer's at once, rather than VertexConsumerProvider.Immediate which can only render the ones provided to it in a map, and 1 other.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static FluidVolumeRenderer.ExpandingVcp VCPS  
  • Constructor Summary

    Constructors 
    Constructor Description
    FluidVolumeRenderer()  
  • Method Summary

    Modifier and Type Method Description
    protected static net.minecraft.client.render.RenderLayer getRenderLayer​(FluidVolume fluid)  
    protected static net.minecraft.client.texture.Sprite[] getSprites​(FluidVolume fluid)  
    abstract void render​(FluidVolume fluid, java.util.List<FluidRenderFace> faces, net.minecraft.client.render.VertexConsumerProvider vcp, net.minecraft.client.util.math.MatrixStack matrices)
    Renders a list of faces of the given fluid at the specified co-ordinates.
    void renderGuiRectangle​(FluidVolume fluid, double x0, double y0, double x1, double y1)  
    protected static void renderSimpleFluid​(java.util.List<FluidRenderFace> faces, net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.texture.Sprite sprite, int colour)
    Deprecated.
    Use renderSimpleFluid(List, VertexConsumer, MatrixStack, Sprite, Sprite, int) instead, which takes both the still and flowing sprites.
    protected static void renderSimpleFluid​(java.util.List<FluidRenderFace> faces, net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.texture.Sprite still, net.minecraft.client.texture.Sprite flowing, int colour)
    Renders a fluid in VertexFormats.POSITION_COLOR_TEXTURE
    protected static java.util.List<FluidRenderFace> splitFaces​(java.util.List<FluidRenderFace> faces)  
    protected static FluidVolumeRenderer.ComponentRenderFaces splitFacesComponent​(java.util.List<FluidRenderFace> faces)
    Like splitFaces(List) but also returns the
    protected static void vertex​(net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, double x, double y, double z, float u, float v, int r, int g, int b, int light, float nx, float ny, float nz)
    Appends a single vertex in VertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL format.
    protected static void vertex​(net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, double x, double y, double z, float u, float v, int r, int g, int b, int a, int light, float nx, float ny, float nz)
    Appends a single vertex in VertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL format.
    protected static void vertex​(net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, double x, double y, double z, float u, float v, int r, int g, int b, int a, FluidRenderFace f)
    Appends a single vertex in VertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL format.
    protected static void vertex​(net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, double x, double y, double z, float u, float v, int r, int g, int b, FluidRenderFace f)
    Appends a single vertex in VertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL format.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

  • Method Details

    • render

      public abstract void render​(FluidVolume fluid, java.util.List<FluidRenderFace> faces, net.minecraft.client.render.VertexConsumerProvider vcp, net.minecraft.client.util.math.MatrixStack matrices)
      Renders a list of faces of the given fluid at the specified co-ordinates.
    • renderGuiRectangle

      public void renderGuiRectangle​(FluidVolume fluid, double x0, double y0, double x1, double y1)
    • splitFaces

      protected static java.util.List<FluidRenderFace> splitFaces​(java.util.List<FluidRenderFace> faces)
    • splitFacesComponent

      protected static FluidVolumeRenderer.ComponentRenderFaces splitFacesComponent​(java.util.List<FluidRenderFace> faces)
      Like splitFaces(List) but also returns the
      Parameters:
      faces -
      Returns:
    • getRenderLayer

      protected static net.minecraft.client.render.RenderLayer getRenderLayer​(FluidVolume fluid)
    • getSprites

      protected static net.minecraft.client.texture.Sprite[] getSprites​(FluidVolume fluid)
    • renderSimpleFluid

      @Deprecated protected static void renderSimpleFluid​(java.util.List<FluidRenderFace> faces, net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.texture.Sprite sprite, int colour)
      Deprecated.
      Use renderSimpleFluid(List, VertexConsumer, MatrixStack, Sprite, Sprite, int) instead, which takes both the still and flowing sprites.
    • renderSimpleFluid

      protected static void renderSimpleFluid​(java.util.List<FluidRenderFace> faces, net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.texture.Sprite still, net.minecraft.client.texture.Sprite flowing, int colour)
      Renders a fluid in VertexFormats.POSITION_COLOR_TEXTURE
    • vertex

      protected static void vertex​(net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, double x, double y, double z, float u, float v, int r, int g, int b, FluidRenderFace f)
      Appends a single vertex in VertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL format.
      Parameters:
      vc - The VertexConsumer to append to.
      matrices - The MatrixStack to apply to the x,y,z positions.
      x - Position - X
      y - Position - Y
      z - Position - Z
      u - Texture - U (0 -> 1)
      v - Texture - V (0 -> 1)
      r - Colour - Red (0 -> 255)
      g - Colour - Green (0 -> 255)
      b - Colour - Blue (0 -> 255)
      f - The source for the light and normal.
    • vertex

      protected static void vertex​(net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, double x, double y, double z, float u, float v, int r, int g, int b, int a, FluidRenderFace f)
      Appends a single vertex in VertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL format.
      Parameters:
      vc - The VertexConsumer to append to.
      matrices - The MatrixStack to apply to the x,y,z positions.
      x - Position - X
      y - Position - Y
      z - Position - Z
      u - Texture - U (0 -> 1)
      v - Texture - V (0 -> 1)
      r - Colour - Red (0 -> 255)
      g - Colour - Green (0 -> 255)
      b - Colour - Blue (0 -> 255)
      a - Colour - Alpha (0 -> 255)
      f - The source for the light and normal.
    • vertex

      protected static void vertex​(net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, double x, double y, double z, float u, float v, int r, int g, int b, int light, float nx, float ny, float nz)
      Appends a single vertex in VertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL format.
      Parameters:
      vc - The VertexConsumer to append to.
      matrices - The MatrixStack to apply to the x,y,z positions.
      x - Position - X
      y - Position - Y
      z - Position - Z
      u - Texture - U (0 -> 1)
      v - Texture - V (0 -> 1)
      r - Colour - Red (0 -> 255)
      g - Colour - Green (0 -> 255)
      b - Colour - Blue (0 -> 255)
      light - Light - packed.
      nx - Normal - X
      ny - Normal - Y
      nz - Normal - Z
    • vertex

      protected static void vertex​(net.minecraft.client.render.VertexConsumer vc, net.minecraft.client.util.math.MatrixStack matrices, double x, double y, double z, float u, float v, int r, int g, int b, int a, int light, float nx, float ny, float nz)
      Appends a single vertex in VertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL format.
      Parameters:
      vc - The VertexConsumer to append to.
      matrices - The MatrixStack to apply to the x,y,z positions.
      x - Position - X
      y - Position - Y
      z - Position - Z
      u - Texture - U (0 -> 1)
      v - Texture - V (0 -> 1)
      r - Colour - Red (0 -> 255)
      g - Colour - Green (0 -> 255)
      b - Colour - Blue (0 -> 255)
      a - Colour - Alpha (0 -> 255)
      light - Light - packed.
      nx - Normal - X
      ny - Normal - Y
      nz - Normal - Z