2013-08-27 00:49:32 +02:00
|
|
|
package mekanism.generators.client.render;
|
2012-11-21 16:14:35 +01:00
|
|
|
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.common.util.MekanismUtils;
|
|
|
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.generators.client.model.ModelAdvancedSolarGenerator;
|
|
|
|
import mekanism.generators.common.tileentity.TileEntityAdvancedSolarGenerator;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2012-11-21 16:14:35 +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-11-21 16:14:35 +01:00
|
|
|
public class RenderAdvancedSolarGenerator extends TileEntitySpecialRenderer
|
|
|
|
{
|
2013-04-18 04:40:11 +02:00
|
|
|
private ModelAdvancedSolarGenerator model = new ModelAdvancedSolarGenerator();
|
2012-11-21 16:14:35 +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-11-21 16:14:35 +01:00
|
|
|
{
|
2013-04-13 02:25:21 +02:00
|
|
|
renderAModelAt((TileEntityAdvancedSolarGenerator)tileEntity, x, y, z, partialTick);
|
2012-11-21 16:14:35 +01:00
|
|
|
}
|
|
|
|
|
2013-04-13 02:25:21 +02:00
|
|
|
private void renderAModelAt(TileEntityAdvancedSolarGenerator tileEntity, double x, double y, double z, float partialTick)
|
2012-11-21 16:14:35 +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-09-28 03:59:47 +02:00
|
|
|
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "AdvancedSolarGenerator.png"));
|
2012-11-21 16:14:35 +01:00
|
|
|
|
|
|
|
switch(tileEntity.facing)
|
|
|
|
{
|
|
|
|
case 2: GL11.glRotatef(90, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
case 3: GL11.glRotatef(270, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
case 4: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
case 5: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
}
|
|
|
|
|
|
|
|
GL11.glRotatef(180, 0f, 0f, 1f);
|
2013-01-25 00:01:59 +01:00
|
|
|
|
2013-04-13 02:25:21 +02:00
|
|
|
model.render(0.0F, 0.06F);
|
2012-11-21 16:14:35 +01:00
|
|
|
GL11.glPopMatrix();
|
|
|
|
}
|
|
|
|
}
|