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-expandingVertexConsumerProvider
that can render any number ofRenderLayer
's at once, rather thanVertexConsumerProvider.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.UserenderSimpleFluid(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 inVertexFormats.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)
LikesplitFaces(List)
but also returns theprotected 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 inVertexFormats.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 inVertexFormats.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 inVertexFormats.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 inVertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL
format.
-
Field Details
-
Constructor Details
-
FluidVolumeRenderer
public FluidVolumeRenderer()
-
-
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
-
splitFaces
-
splitFacesComponent
protected static FluidVolumeRenderer.ComponentRenderFaces splitFacesComponent(java.util.List<FluidRenderFace> faces)LikesplitFaces(List)
but also returns the- Parameters:
faces
-- Returns:
-
getRenderLayer
-
getSprites
-
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.UserenderSimpleFluid(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 inVertexFormats.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 inVertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL
format.- Parameters:
vc
- TheVertexConsumer
to append to.matrices
- TheMatrixStack
to apply to the x,y,z positions.x
- Position - Xy
- Position - Yz
- Position - Zu
- 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 inVertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL
format.- Parameters:
vc
- TheVertexConsumer
to append to.matrices
- TheMatrixStack
to apply to the x,y,z positions.x
- Position - Xy
- Position - Yz
- Position - Zu
- 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 inVertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL
format.- Parameters:
vc
- TheVertexConsumer
to append to.matrices
- TheMatrixStack
to apply to the x,y,z positions.x
- Position - Xy
- Position - Yz
- Position - Zu
- 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 - Xny
- Normal - Ynz
- 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 inVertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL
format.- Parameters:
vc
- TheVertexConsumer
to append to.matrices
- TheMatrixStack
to apply to the x,y,z positions.x
- Position - Xy
- Position - Yz
- Position - Zu
- 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 - Xny
- Normal - Ynz
- Normal - Z
-