Mekanism-tilera-Edition/src/minecraft/mekanism/client/RenderPressurizedTube.java
Aidan Brady 51d525e350 v5.5.0 Release #1
*Removed unneeded imports.
*getMaxGas() in IGasStorage.
*Fixed Hydrogen Generator continuously draining hydrogen.
*Improved energy transfer protocol to equally distribute remainder.
*Gas transfer protocol now ignores full acceptors.
2013-03-28 15:36:05 -04:00

55 lines
1.5 KiB
Java

package mekanism.client;
import java.util.Arrays;
import org.lwjgl.opengl.GL11;
import net.minecraftforge.common.ForgeDirection;
import mekanism.api.GasTransmission;
import mekanism.api.ITubeConnection;
import mekanism.common.TileEntityPressurizedTube;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderPressurizedTube extends TileEntitySpecialRenderer
{
private ModelTransmitter model;
public RenderPressurizedTube()
{
model = new ModelTransmitter();
}
public void renderAModelAt(TileEntityPressurizedTube tileEntity, double d, double d1, double d2, float f)
{
bindTextureByName("/mods/mekanism/render/PressurizedTube.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
ITubeConnection[] connections = GasTransmission.getConnections(tileEntity);
for(ITubeConnection connection : connections)
{
if(connection != null)
{
int side = Arrays.asList(connections).indexOf(connection);
if(connection.canTubeConnect(ForgeDirection.getOrientation(side).getOpposite()))
{
model.renderSide(ForgeDirection.getOrientation(side));
}
}
}
model.Center.render(0.0625F);
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8)
{
renderAModelAt((TileEntityPressurizedTube)tileEntity, var2, var4, var6, var8);
}
}