2013-11-03 17:38:36 +01:00
|
|
|
package mekanism.client.render.tileentity;
|
|
|
|
|
|
|
|
import mekanism.client.model.ModelGasTank;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityGasTank;
|
2013-11-03 17:38:36 +01:00
|
|
|
import mekanism.common.util.MekanismUtils;
|
|
|
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
|
|
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
2013-11-12 01:27:36 +01:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
2013-11-03 17:38:36 +01:00
|
|
|
public class RenderGasTank extends TileEntitySpecialRenderer
|
|
|
|
{
|
|
|
|
private ModelGasTank model = new ModelGasTank();
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-11-03 17:38:36 +01:00
|
|
|
@Override
|
|
|
|
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
|
|
|
|
{
|
2013-11-12 01:27:36 +01:00
|
|
|
renderAModelAt((TileEntityGasTank)tileEntity, x, y, z, partialTick);
|
2013-11-03 17:38:36 +01:00
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-11-03 17:38:36 +01:00
|
|
|
private void renderAModelAt(TileEntityGasTank tileEntity, double x, double y, double z, float partialTick)
|
|
|
|
{
|
|
|
|
GL11.glPushMatrix();
|
|
|
|
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
|
|
|
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "GasTank.png"));
|
|
|
|
|
2014-03-08 02:00:25 +01:00
|
|
|
switch(tileEntity.facing)
|
|
|
|
{
|
|
|
|
case 2: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break;
|
2013-11-03 17:38:36 +01:00
|
|
|
case 3: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
case 4: GL11.glRotatef(90, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
case 5: GL11.glRotatef(270, 0.0F, 1.0F, 0.0F); break;
|
2014-03-08 02:00:25 +01:00
|
|
|
}
|
|
|
|
|
2013-11-03 17:38:36 +01:00
|
|
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
|
|
|
model.render(0.0625F);
|
|
|
|
GL11.glPopMatrix();
|
|
|
|
}
|
|
|
|
}
|