2013-02-22 04:03:54 +01:00
|
|
|
package mekanism.client;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.client.renderer.RenderBlocks;
|
|
|
|
import net.minecraft.world.IBlockAccess;
|
2013-06-26 23:49:47 +02:00
|
|
|
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
2013-02-22 04:03:54 +01:00
|
|
|
import cpw.mods.fml.client.FMLClientHandler;
|
|
|
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
2013-04-13 16:33:37 +02:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2013-02-22 04:03:54 +01:00
|
|
|
|
2013-04-13 16:33:37 +02:00
|
|
|
@SideOnly(Side.CLIENT)
|
2013-03-25 17:00:45 +01:00
|
|
|
public class TransmitterRenderer implements ISimpleBlockRenderingHandler
|
2013-02-22 04:03:54 +01:00
|
|
|
{
|
2013-03-25 17:00:45 +01:00
|
|
|
public ModelTransmitter transmitter = new ModelTransmitter();
|
2013-02-22 04:03:54 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
|
|
|
|
{
|
|
|
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
|
|
|
GL11.glRotatef(180F, 0.0F, -1.0F, 0.0F);
|
|
|
|
GL11.glTranslated(0.0F, -1.0F, 0.0F);
|
2013-03-25 17:00:45 +01:00
|
|
|
|
|
|
|
switch(metadata)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
GL11.glBindTexture(3553, FMLClientHandler.instance().getClient().renderEngine.getTexture("/mods/mekanism/render/PressurizedTube.png"));
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
GL11.glBindTexture(3553, FMLClientHandler.instance().getClient().renderEngine.getTexture("/mods/mekanism/render/UniversalCable.png"));
|
|
|
|
break;
|
2013-04-18 04:40:11 +02:00
|
|
|
case 2:
|
|
|
|
GL11.glBindTexture(3553, FMLClientHandler.instance().getClient().renderEngine.getTexture("/mods/mekanism/render/MechanicalPipe.png"));
|
|
|
|
break;
|
2013-03-25 17:00:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
transmitter.Center.render(0.0625F);
|
|
|
|
transmitter.Up.render(0.0625F);
|
|
|
|
transmitter.Down.render(0.0625F);
|
2013-02-22 04:03:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean shouldRender3DInInventory()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getRenderId()
|
|
|
|
{
|
2013-03-25 17:00:45 +01:00
|
|
|
return ClientProxy.TRANSMITTER_RENDER_ID;
|
2013-02-22 04:03:54 +01:00
|
|
|
}
|
|
|
|
}
|