public class RenderHelpers
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
RenderHelpers.IFluidContextRender
|
| Modifier and Type | Field and Description |
|---|---|
static net.minecraft.util.IIcon |
EMPTYICON
An icon that contains to texture, useful for when you want to render nothing.
|
| Constructor and Description |
|---|
RenderHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static void |
bindTexture(net.minecraft.util.ResourceLocation texture)
Bind a texture to the rendering engine.
|
static net.minecraft.util.IIcon |
getFluidIcon(net.minecraftforge.fluids.FluidStack fluid,
net.minecraftforge.common.util.ForgeDirection side)
Get the icon of a fluid for a side in a safe way.
|
static org.apache.commons.lang3.tuple.Triple<java.lang.Float,java.lang.Float,java.lang.Float> |
intToRGB(int color)
Convert a color in integer representation to seperated r, g and b colors.
|
static void |
renderFaceDirection(net.minecraftforge.common.util.ForgeDirection renderDirection,
net.minecraft.client.renderer.RenderBlocks renderer,
net.minecraft.block.Block block,
double x,
double y,
double z,
net.minecraft.util.IIcon blockIconFromSideAndMetadata)
Call the correct face renderer on the renderer depending on the given renderDirection.
|
static void |
renderFluidContext(net.minecraftforge.fluids.FluidStack fluid,
double x,
double y,
double z,
boolean enableAlpha,
RenderHelpers.IFluidContextRender render)
Prepare a GL context for rendering fluids.
|
static void |
renderFluidContext(net.minecraftforge.fluids.FluidStack fluid,
double x,
double y,
double z,
RenderHelpers.IFluidContextRender render)
Prepare a GL context for rendering fluids with alpha rendering enabled.
|
static void |
renderTileFluidContext(net.minecraftforge.fluids.FluidStack fluid,
double x,
double y,
double z,
boolean enableAlpha,
net.minecraft.tileentity.TileEntity tile,
RenderHelpers.IFluidContextRender render)
Prepare a GL context for rendering fluids for tile entities.
|
static void |
renderTileFluidContext(net.minecraftforge.fluids.FluidStack fluid,
double x,
double y,
double z,
net.minecraft.tileentity.TileEntity tile,
RenderHelpers.IFluidContextRender render)
Prepare a GL context for rendering fluids for tile entities with alpha rendering enabled.
|
static int |
RGBToInt(int r,
int g,
int b)
Convert r, g and b colors to an integer representation.
|
static void |
setInvertedRenderBounds(net.minecraft.client.renderer.RenderBlocks renderer,
net.minecraft.block.Block block)
Inverts the block bounds for the given block inside the given renderer.
|
static void |
setRenderBlocksUVRotation(net.minecraft.client.renderer.RenderBlocks renderer,
net.minecraftforge.common.util.ForgeDirection side,
int rotation)
Set the correct rotation of the given renderer given a
ForgeDirection. |
public static net.minecraft.util.IIcon EMPTYICON
public static void renderFaceDirection(net.minecraftforge.common.util.ForgeDirection renderDirection,
net.minecraft.client.renderer.RenderBlocks renderer,
net.minecraft.block.Block block,
double x,
double y,
double z,
net.minecraft.util.IIcon blockIconFromSideAndMetadata)
renderDirection - direction to call the renderer method for.renderer - Renderer to call the face renderer on.block - To be passed to renderer.x - To be passed to renderer.y - To be passed to renderer.z - To be passed to renderer.blockIconFromSideAndMetadata - To be passed to renderer.public static void setRenderBlocksUVRotation(net.minecraft.client.renderer.RenderBlocks renderer,
net.minecraftforge.common.util.ForgeDirection side,
int rotation)
ForgeDirection.
It will use reflection to set the correct field in the RenderBlocks.renderer - The renderer to set the rotation at.side - The ForgeDirection to set a rotation for.rotation - The rotation to set.RenderBlockspublic static void bindTexture(net.minecraft.util.ResourceLocation texture)
texture - The texture to bind.public static int RGBToInt(int r,
int g,
int b)
r - redg - greenb - bluepublic static org.apache.commons.lang3.tuple.Triple<java.lang.Float,java.lang.Float,java.lang.Float> intToRGB(int color)
color - The color in integer representation.public static void setInvertedRenderBounds(net.minecraft.client.renderer.RenderBlocks renderer,
net.minecraft.block.Block block)
renderer - The renderer.block - The block.public static net.minecraft.util.IIcon getFluidIcon(net.minecraftforge.fluids.FluidStack fluid,
net.minecraftforge.common.util.ForgeDirection side)
fluid - The fluid stack.side - The side to get the icon from, UP if null.public static void renderFluidContext(net.minecraftforge.fluids.FluidStack fluid,
double x,
double y,
double z,
RenderHelpers.IFluidContextRender render)
fluid - The fluid stack.x - Xy - Yz - Zrender - The actual fluid renderer.public static void renderFluidContext(net.minecraftforge.fluids.FluidStack fluid,
double x,
double y,
double z,
boolean enableAlpha,
RenderHelpers.IFluidContextRender render)
fluid - The fluid stack.x - Xy - Yz - ZenableAlpha - If alpha rendering should be enabled.render - The actual fluid renderer.public static void renderTileFluidContext(net.minecraftforge.fluids.FluidStack fluid,
double x,
double y,
double z,
net.minecraft.tileentity.TileEntity tile,
RenderHelpers.IFluidContextRender render)
fluid - The fluid stack.x - Xy - Yz - Ztile - The tile.render - The actual fluid renderer.public static void renderTileFluidContext(net.minecraftforge.fluids.FluidStack fluid,
double x,
double y,
double z,
boolean enableAlpha,
net.minecraft.tileentity.TileEntity tile,
RenderHelpers.IFluidContextRender render)
fluid - The fluid stack.x - Xy - Yz - ZenableAlpha - If alpha rendering should be enabled.tile - The tile.render - The actual fluid renderer.