public class ConnectableIcon
extends java.lang.Object
implements net.minecraft.util.IIcon
IIcon that has several icons and needs multiple render passes for
making it possible to dynamically render connected textures.
Blocks that use this icon must implement IMultiRenderPassBlock.
Five icons are necessary for this.
| Modifier and Type | Field and Description |
|---|---|
protected static DirectionCorner[][] |
CONNECT_CORNER_MATRIX |
protected static net.minecraftforge.common.util.ForgeDirection[][] |
CONNECT_MATRIX |
protected boolean[] |
connectWithSides |
protected boolean[] |
connectWithSidesCorner |
protected static int |
EDGES |
protected net.minecraft.util.IIcon[] |
icons |
protected net.minecraft.util.IIcon |
inventoryBlockIcon |
protected boolean |
isInventoryBlock |
protected static int |
LAYERS |
protected int |
renderPass |
protected int |
side |
protected static int |
SIDES |
| Constructor and Description |
|---|
ConnectableIcon(net.minecraft.util.IIcon background,
net.minecraft.util.IIcon borders,
net.minecraft.util.IIcon corners,
net.minecraft.util.IIcon innerCorners,
net.minecraft.util.IIcon inventoryBlockIcon)
Make a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect(net.minecraftforge.common.util.ForgeDirection direction,
boolean connect)
Set the connection to a certain
ForgeDirection. |
void |
connectCorner(DirectionCorner direction,
boolean connect)
Set the connection to a certain
DirectionCorner. |
boolean[] |
getConnectWithSides()
Get the array that is indexed by the
ForgeDirection ordinal values with
their respective value for whether or not this block should connect to that block. |
boolean[] |
getConnectWithSidesCorner()
Get the array that is indexed by the
DirectionCorner ordinal values with
their respective value for whether or not this block should connect to that block. |
protected int |
getCurrentLayer() |
protected int |
getCurrentRotation() |
protected int |
getCurrentSide() |
int |
getIconHeight() |
java.lang.String |
getIconName() |
int |
getIconWidth() |
protected net.minecraft.util.IIcon |
getInnerIcon() |
float |
getInterpolatedU(double d0) |
float |
getInterpolatedV(double d0) |
float |
getMaxU() |
float |
getMaxV() |
float |
getMinU() |
float |
getMinV() |
int |
getRequiredPasses()
Get the required render passes for rendering all the possible connections.
|
void |
prepareIcon(int side,
int renderPass,
net.minecraft.client.renderer.RenderBlocks renderBlocks)
Will be called before rendering the icon to set the correct inner icon.
|
void |
setInventoryBlock(boolean isInventoryBlock)
Define whether or not the current rendering is for an inventory block.
|
protected void |
setRenderPass(int renderPass) |
protected void |
setSide(int side) |
protected boolean |
shouldConnect(int side,
int rotation) |
protected boolean |
shouldConnectCorner(int side,
int rotation) |
protected boolean |
shouldRender(int layer) |
protected static final int LAYERS
protected static final int EDGES
protected static final int SIDES
protected net.minecraft.util.IIcon[] icons
protected net.minecraft.util.IIcon inventoryBlockIcon
protected int renderPass
protected int side
protected boolean isInventoryBlock
protected static final net.minecraftforge.common.util.ForgeDirection[][] CONNECT_MATRIX
protected static final DirectionCorner[][] CONNECT_CORNER_MATRIX
protected boolean[] connectWithSides
protected boolean[] connectWithSidesCorner
public ConnectableIcon(net.minecraft.util.IIcon background,
net.minecraft.util.IIcon borders,
net.minecraft.util.IIcon corners,
net.minecraft.util.IIcon innerCorners,
net.minecraft.util.IIcon inventoryBlockIcon)
background - The background icon.borders - The border icon.corners - The corner icon.innerCorners - The inner corner icon.inventoryBlockIcon - The inventory block icon.protected void setRenderPass(int renderPass)
protected void setSide(int side)
protected net.minecraft.util.IIcon getInnerIcon()
protected boolean shouldConnect(int side,
int rotation)
protected boolean shouldConnectCorner(int side,
int rotation)
protected boolean shouldRender(int layer)
public int getIconWidth()
getIconWidth in interface net.minecraft.util.IIconpublic int getIconHeight()
getIconHeight in interface net.minecraft.util.IIconpublic float getMinU()
getMinU in interface net.minecraft.util.IIconpublic float getMaxU()
getMaxU in interface net.minecraft.util.IIconpublic float getInterpolatedU(double d0)
getInterpolatedU in interface net.minecraft.util.IIconpublic float getMinV()
getMinV in interface net.minecraft.util.IIconpublic float getMaxV()
getMaxV in interface net.minecraft.util.IIconpublic float getInterpolatedV(double d0)
getInterpolatedV in interface net.minecraft.util.IIconpublic java.lang.String getIconName()
getIconName in interface net.minecraft.util.IIconprotected int getCurrentLayer()
protected int getCurrentRotation()
protected int getCurrentSide()
public int getRequiredPasses()
public void prepareIcon(int side,
int renderPass,
net.minecraft.client.renderer.RenderBlocks renderBlocks)
side - The side that will be rendered.renderPass - The render pass for that side.renderBlocks - The RenderBlocks instance.public void setInventoryBlock(boolean isInventoryBlock)
isInventoryBlock - The new valuepublic boolean[] getConnectWithSides()
ForgeDirection ordinal values with
their respective value for whether or not this block should connect to that block.public boolean[] getConnectWithSidesCorner()
DirectionCorner ordinal values with
their respective value for whether or not this block should connect to that block.public void connect(net.minecraftforge.common.util.ForgeDirection direction,
boolean connect)
ForgeDirection.direction - The direction to enable/disable the connection to.connect - If the connection for the given direction should be enabled.public void connectCorner(DirectionCorner direction, boolean connect)
DirectionCorner.direction - The direction to enable/disable the connection to.connect - If the connection for the given direction should be enabled.