Class FluidVolumeRenderer
java.lang.Object
alexiil.mc.lib.attributes.fluid.render.FluidVolumeRenderer
- Direct Known Subclasses:
DefaultFluidVolumeRenderer
,EnchantmentGlintFluidRenderer
,ImplicitVanillaFluidVolumeRenderer
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
Modifier and TypeClassDescriptionstatic final class
static final class
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static net.minecraft.client.render.RenderLayer
getRenderLayer
(FluidVolume fluid) protected static net.minecraft.client.texture.Sprite[]
getSprites
(FluidVolume fluid) abstract void
render
(FluidVolume fluid, 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
(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, for removal: This API element is subject to removal in a future version.protected static void
renderSimpleFluid
(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 List<FluidRenderFace>
splitFaces
(List<FluidRenderFace> faces) protected static FluidVolumeRenderer.ComponentRenderFaces
splitFacesComponent
(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
-
VCPS
-
-
Constructor Details
-
FluidVolumeRenderer
public FluidVolumeRenderer()
-
-
Method Details
-
render
public abstract void render(FluidVolume fluid, 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(List<FluidRenderFace> faces) LikesplitFaces(List)
but also returns the- Parameters:
faces
-- Returns:
-
getRenderLayer
-
getSprites
-
renderSimpleFluid
@Deprecated(since="0.6.0", forRemoval=true) protected static void renderSimpleFluid(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, for removal: This API element is subject to removal in a future version.UserenderSimpleFluid(List, VertexConsumer, MatrixStack, Sprite, Sprite, int)
instead, which takes both the still and flowing sprites. -
renderSimpleFluid
protected static void renderSimpleFluid(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
-
renderSimpleFluid(List, VertexConsumer, MatrixStack, Sprite, Sprite, int)
instead, which takes both the still and flowing sprites.