Search in sources :

Example 1 with IconTransformation

use of cofh.repack.codechicken.lib.render.uv.IconTransformation 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)

Example 2 with IconTransformation

use of cofh.repack.codechicken.lib.render.uv.IconTransformation in project LogisticsPipes by RS485.

the class ThermalDynamicsProxy method registerTextures.

@Override
public void registerTextures(IIconRegister iconRegister) {
    if (connectionTextureBasic == null) {
        connectionTextureBasic = new IconTransformation(iconRegister.registerIcon("logisticspipes:" + "pipes/ThermalDynamicsConnection-Basic"));
        connectionTextureActive = new IconTransformation(iconRegister.registerIcon("logisticspipes:" + "pipes/ThermalDynamicsConnection-Active"));
        connectionTextureInactive = new IconTransformation(iconRegister.registerIcon("logisticspipes:" + "pipes/ThermalDynamicsConnection-Inactive"));
    } else {
        connectionTextureBasic.icon = iconRegister.registerIcon("logisticspipes:" + "pipes/ThermalDynamicsConnection-Basic");
        connectionTextureActive.icon = iconRegister.registerIcon("logisticspipes:" + "pipes/ThermalDynamicsConnection-Active");
        connectionTextureInactive.icon = iconRegister.registerIcon("logisticspipes:" + "pipes/ThermalDynamicsConnection-Inactive");
    }
}
Also used : IconTransformation(cofh.repack.codechicken.lib.render.uv.IconTransformation)

Aggregations

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