Search in sources :

Example 1 with Translation

use of cofh.repack.codechicken.lib.vec.Translation in project LogisticsPipes by RS485.

the class ThermalDynamicsProxy method renderPipeConnections.

@Override
@SideOnly(Side.CLIENT)
public void renderPipeConnections(LogisticsTileGenericPipe pipeTile, RenderBlocks renderer) {
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        if (pipeTile.renderState.pipeConnectionMatrix.isTDConnected(dir)) {
            IconTransformation texture = connectionTextureBasic;
            if (pipeTile.renderState.textureMatrix.isRouted()) {
                if (pipeTile.renderState.textureMatrix.isRoutedInDir(dir)) {
                    texture = connectionTextureActive;
                } else {
                    texture = connectionTextureInactive;
                }
            }
            double move = 0.25;
            Translation localTranslation = new Translation(pipeTile.xCoord + 0.5D + dir.offsetX * move, pipeTile.yCoord + 0.5D + dir.offsetY * move, pipeTile.zCoord + 0.5D + dir.offsetZ * move);
            RenderDuct.modelConnection[2][dir.ordinal()].render(new CCRenderState.IVertexOperation[] { localTranslation, texture });
        }
    }
}
Also used : Translation(cofh.repack.codechicken.lib.vec.Translation) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) CCRenderState(cofh.repack.codechicken.lib.render.CCRenderState) IconTransformation(cofh.repack.codechicken.lib.render.uv.IconTransformation) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

CCRenderState (cofh.repack.codechicken.lib.render.CCRenderState)1 IconTransformation (cofh.repack.codechicken.lib.render.uv.IconTransformation)1 Translation (cofh.repack.codechicken.lib.vec.Translation)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)1