resonant-induction/common/dark/BasicUtilities/renders/RenderPipe.java
Rseifert 28f62284a0 moved over from other repo
got around to moving this so Calc could help me with the clean up of it.
So far i havn't changed much but will soon. The main focus for the next
week on the mod will be just cleanup and bug fixing. I will also be
moving the motor from steam power to here. The mod has alos been renamed
since now it contains more than just pipes.
2012-11-14 13:16:22 -05:00

63 lines
No EOL
2 KiB
Java

package dark.BasicUtilities.renders;
import net.minecraft.src.ModelBase;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import dark.BasicUtilities.BasicUtilitiesMain;
import dark.BasicUtilities.api.Liquid;
import dark.BasicUtilities.pipes.TileEntityPipe;
public class RenderPipe extends TileEntitySpecialRenderer
{
Liquid type;
int size = 6;
private ModelPipe fourPipe;
private ModelLargePipe SixPipe;
private ModelBase model = fourPipe;
public RenderPipe()
{
fourPipe = new ModelPipe();
SixPipe = new ModelLargePipe();
}
public void renderAModelAt(TileEntityPipe tileEntity, double d, double d1, double d2, float f)
{
//Texture file
type = tileEntity.getType();
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
switch(type.ordinal())
{
case 0: bindTextureByName(BasicUtilitiesMain.textureFile+"pipes/SixSteamPipe.png");break;
case 1: bindTextureByName(BasicUtilitiesMain.textureFile+"pipes/SixWaterPipe.png");break;
case 2: bindTextureByName(BasicUtilitiesMain.textureFile+"pipes/SixLavaPipe.png");break;
case 3: bindTextureByName(BasicUtilitiesMain.textureFile+"pipes/SixOilPipe.png");break;
default:bindTextureByName(BasicUtilitiesMain.textureFile+"pipes/DefaultPipe.png"); break;
}
if(tileEntity.connectedBlocks[0] != null) SixPipe.renderBottom();
if(tileEntity.connectedBlocks[1] != null) SixPipe.renderTop();
if(tileEntity.connectedBlocks[3] != null) SixPipe.renderFront();
if(tileEntity.connectedBlocks[2] != null) SixPipe.renderBack();
if(tileEntity.connectedBlocks[5] != null) SixPipe.renderRight();
if(tileEntity.connectedBlocks[4] != null) SixPipe.renderLeft();
SixPipe.renderMiddle();
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) {
this.renderAModelAt((TileEntityPipe)tileEntity, var2, var4, var6, var8);
}
}