public class BlockRenderPipeline extends RenderPipeline
| Modifier and Type | Field and Description |
|---|---|
java.util.function.Supplier<Cuboid> |
bounds
Called to get a shape of this block to be rendered.
|
java.util.function.Function<Direction,Color> |
colorMultiplier
Gets the color of a specific face.
|
ComponentProvider<? extends ComponentMap> |
componentProvider |
java.util.function.Predicate<Direction> |
renderSide
Called when this block is to be rendered.
|
java.util.function.Function<Direction,java.util.Optional<Texture>> |
texture
Called to get the texture of this block for a certain side.
|
| Constructor and Description |
|---|
BlockRenderPipeline(ComponentProvider componentProvider) |
| Modifier and Type | Method and Description |
|---|---|
MeshModel |
draw(MeshModel model)
Draws a standard block.
|
static MeshModel |
drawCube(MeshModel model) |
static MeshModel |
drawCube(MeshModel model,
Cuboid cuboid,
CubeTextureCoordinates textureCoordinates)
Binds the specified texture coordinates to the model for the specified cuboid for rendering
|
static MeshModel |
drawCube(MeshModel model,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
CubeTextureCoordinates textureCoordinates)
Applies the textures to the model
|
static Face |
drawDir(Direction dir,
MeshModel model,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
CubeTextureCoordinates textureCoordinates)
Creates a face of the model in a specified direction
|
static Face |
drawDown(MeshModel model,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
CubeTextureCoordinates textureCoordinates)
Creates the botom face of the model
|
static Face |
drawEast(MeshModel model,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
CubeTextureCoordinates textureCoordinates)
Creates the east face of the model
|
static Face |
drawNorth(MeshModel model,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
CubeTextureCoordinates textureCoordinates)
Creates the north face of the model
|
static Face |
drawSouth(MeshModel model,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
CubeTextureCoordinates textureCoordinates)
Creates the south face of the model
|
static Face |
drawUp(MeshModel model,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
CubeTextureCoordinates textureCoordinates)
Creates the top face of the model
|
static Face |
drawWest(MeshModel model,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
CubeTextureCoordinates textureCoordinates)
Creates the west face of the model
|
BlockRenderPipeline |
filter(java.util.function.Predicate<Direction> renderSide)
This method is called to specify which sides should and shouldn't render.
|
BlockRenderPipeline |
withBounds(Cuboid bounds)
This method is called to specify the size of the block, defaults to the size
of the block's
Cuboid or a full 1×1×1 cube. |
BlockRenderPipeline |
withBounds(java.util.function.Supplier<Cuboid> bounds)
This method is called to specify the size of the block, defaults to the size
of the block's
Cuboid or a full 1×1×1 cube. |
BlockRenderPipeline |
withColor(Color colorMultiplier)
This method is called to specify a color multiplier to use for the block.
|
BlockRenderPipeline |
withColor(java.util.function.Function<Direction,Color> colorMultiplier)
This method is called to specify a color multiplier to use for the block.
|
BlockRenderPipeline |
withTexture(java.util.function.Function<Direction,java.util.Optional<Texture>> texture)
This method is called to specify a texture to use for the block.
|
BlockRenderPipeline |
withTexture(Texture texture)
This method is called to specify a texture to use for the block.
|
public final ComponentProvider<? extends ComponentMap> componentProvider
public java.util.function.Function<Direction,java.util.Optional<Texture>> texture
public java.util.function.Supplier<Cuboid> bounds
public java.util.function.Predicate<Direction> renderSide
public BlockRenderPipeline(ComponentProvider componentProvider)
public BlockRenderPipeline withTexture(java.util.function.Function<Direction,java.util.Optional<Texture>> texture)
public BlockRenderPipeline withTexture(Texture texture)
texture - The Texture for all sides.public BlockRenderPipeline withBounds(java.util.function.Supplier<Cuboid> bounds)
Cuboid or a full 1×1×1 cube.bounds - A supplier that returns
the Cuboid which specifies the block size.public BlockRenderPipeline withBounds(Cuboid bounds)
Cuboid or a full 1×1×1 cube.bounds - The Cuboid which specifies the block size.public BlockRenderPipeline filter(java.util.function.Predicate<Direction> renderSide)
renderSide - A predicate that takes a Direction
and returns a boolean specifying whether or not the side should render.public BlockRenderPipeline withColor(Color colorMultiplier)
public BlockRenderPipeline withColor(java.util.function.Function<Direction,Color> colorMultiplier)
colorMultiplier - The Color multiplier for all sides.public MeshModel draw(MeshModel model)
model - VertexModel to usepublic static Face drawDown(MeshModel model, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, CubeTextureCoordinates textureCoordinates)
model - The model to renderminX - Min X coordminY - Min Y coordminZ - Min Z coordmaxX - Max X coordmaxY - Max Y coordmaxZ - Max Z coordtextureCoordinates - Texture coordinates to renderpublic static Face drawUp(MeshModel model, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, CubeTextureCoordinates textureCoordinates)
model - The model to renderminX - Min X coordminY - Min Y coordminZ - Min Z coordmaxX - Max X coordmaxY - Max Y coordmaxZ - Max Z coordtextureCoordinates - Texture coordinates to renderpublic static Face drawNorth(MeshModel model, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, CubeTextureCoordinates textureCoordinates)
model - The model to renderminX - Min X coordminY - Min Y coordminZ - Min Z coordmaxX - Max X coordmaxY - Max Y coordmaxZ - Max Z coordtextureCoordinates - Texture coordinates to renderpublic static Face drawSouth(MeshModel model, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, CubeTextureCoordinates textureCoordinates)
model - The model to renderminX - Min X coordminY - Min Y coordminZ - Min Z coordmaxX - Max X coordmaxY - Max Y coordmaxZ - Max Z coordtextureCoordinates - Texture coordinates to renderpublic static Face drawWest(MeshModel model, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, CubeTextureCoordinates textureCoordinates)
model - The model to renderminX - Min X coordminY - Min Y coordminZ - Min Z coordmaxX - Max X coordmaxY - Max Y coordmaxZ - Max Z coordtextureCoordinates - Texture coordinates to renderpublic static Face drawEast(MeshModel model, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, CubeTextureCoordinates textureCoordinates)
model - The model to renderminX - Min X coordminY - Min Y coordminZ - Min Z coordmaxX - Max X coordmaxY - Max Y coordmaxZ - Max Z coordtextureCoordinates - Texture coordinates to renderpublic static Face drawDir(Direction dir, MeshModel model, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, CubeTextureCoordinates textureCoordinates)
dir - The direction of the face to makemodel - The model to useminX - Min X coordminY - Min Y coordminZ - Min Z coordmaxX - Max X coordmaxY - Max Y coordmaxZ - Max Z coordtextureCoordinates - Texture coordinates to renderpublic static MeshModel drawCube(MeshModel model, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, CubeTextureCoordinates textureCoordinates)
model - The model to useminX - Min X coordminY - Min Y coordminZ - Min Z coordmaxX - Max X coordmaxY - Max Y coordmaxZ - Max Z coordtextureCoordinates - Texture coordinates to renderpublic static MeshModel drawCube(MeshModel model, Cuboid cuboid, CubeTextureCoordinates textureCoordinates)
model - The model to apply the textures tocuboid - The cuboid where the model applies totextureCoordinates - The texture coordinates to use