2012-12-23 20:46:11 +01:00
|
|
|
package mekanism.client;
|
2012-12-19 21:23:55 +01:00
|
|
|
|
2012-12-23 20:46:11 +01:00
|
|
|
import mekanism.common.TileEntityTheoreticalElementizer;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2012-12-19 21:23:55 +01:00
|
|
|
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
2013-04-13 16:33:37 +02:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
2012-12-23 20:46:11 +01:00
|
|
|
public class RenderTheoreticalElementizer extends TileEntitySpecialRenderer
|
2012-12-19 21:23:55 +01:00
|
|
|
{
|
2012-12-23 20:46:11 +01:00
|
|
|
private ModelTheoreticalElementizer model = new ModelTheoreticalElementizer();
|
2012-12-19 21:23:55 +01:00
|
|
|
|
2013-02-22 04:03:54 +01:00
|
|
|
@Override
|
2013-04-13 02:25:21 +02:00
|
|
|
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
|
2012-12-19 21:23:55 +01:00
|
|
|
{
|
2013-04-13 02:25:21 +02:00
|
|
|
renderAModelAt((TileEntityTheoreticalElementizer)tileEntity, x, y, z, partialTick);
|
2012-12-19 21:23:55 +01:00
|
|
|
}
|
|
|
|
|
2013-04-13 02:25:21 +02:00
|
|
|
private void renderAModelAt(TileEntityTheoreticalElementizer tileEntity, double x, double y, double z, float partialTick)
|
2012-12-19 21:23:55 +01:00
|
|
|
{
|
|
|
|
GL11.glPushMatrix();
|
2013-04-13 02:25:21 +02:00
|
|
|
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
2013-03-18 17:23:57 +01:00
|
|
|
bindTextureByName("/mods/mekanism/render/TheoreticalElementizer.png");
|
2012-12-19 21:23:55 +01:00
|
|
|
|
|
|
|
switch(tileEntity.facing)
|
|
|
|
{
|
|
|
|
case 2: GL11.glRotatef(270, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
case 3: GL11.glRotatef(90, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
case 4: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
case 5: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
}
|
|
|
|
|
|
|
|
GL11.glRotatef(180F, 0.0F, 1.0F, 1.0F);
|
|
|
|
GL11.glRotatef(90F, -1.0F, 0.0F, 0.0F);
|
2013-02-22 04:03:54 +01:00
|
|
|
GL11.glRotatef(270F, 0.0F, 1.0F, 0.0F);
|
2012-12-19 21:23:55 +01:00
|
|
|
model.render(0.0625F);
|
|
|
|
GL11.glPopMatrix();
|
|
|
|
}
|
|
|
|
}
|