2013-05-20 00:43:01 +02:00
|
|
|
package mekanism.client;
|
|
|
|
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
2013-05-29 17:35:30 +02:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
2013-07-20 18:10:14 +02:00
|
|
|
import mekanism.common.MekanismUtils;
|
2013-05-20 00:43:01 +02:00
|
|
|
import mekanism.common.TileEntityChargepad;
|
2013-07-20 18:10:14 +02:00
|
|
|
import mekanism.common.MekanismUtils.ResourceType;
|
2013-05-20 00:43:01 +02:00
|
|
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
|
2013-05-29 17:35:30 +02:00
|
|
|
@SideOnly(Side.CLIENT)
|
2013-05-20 00:43:01 +02:00
|
|
|
public class RenderChargepad extends TileEntitySpecialRenderer
|
|
|
|
{
|
|
|
|
private ModelChargepad model = new ModelChargepad();
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
|
|
|
|
{
|
|
|
|
renderAModelAt((TileEntityChargepad)tileEntity, x, y, z, 1F);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void renderAModelAt(TileEntityChargepad 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);
|
2013-07-20 18:10:14 +02:00
|
|
|
func_110628_a(MekanismUtils.getResource(ResourceType.RENDER, "Chargepad.png"));
|
2013-05-20 00:43:01 +02:00
|
|
|
|
|
|
|
switch(tileEntity.facing)
|
|
|
|
{
|
2013-05-24 05:03:06 +02:00
|
|
|
case 2: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break;
|
|
|
|
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;
|
2013-05-20 00:43:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
|
|
|
model.render(0.0625F);
|
|
|
|
GL11.glPopMatrix();
|
|
|
|
}
|
|
|
|
}
|