Mekanism-tilera-Edition/common/mekanism/client/BasicRenderingHandler.java
2013-06-28 19:43:45 -04:00

58 lines
1.3 KiB
Java

package mekanism.client;
import mekanism.common.Mekanism;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class BasicRenderingHandler implements ISimpleBlockRenderingHandler
{
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
GL11.glPushMatrix();
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
if(block.blockID == Mekanism.basicBlockID)
{
MekanismRenderer.renderItem(renderer, metadata, block);
}
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
if(block.blockID == Mekanism.basicBlockID)
{
int metadata = world.getBlockMetadata(x, y, z);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBoundsFromBlock(block);
return true;
}
return false;
}
@Override
public boolean shouldRender3DInInventory()
{
return true;
}
@Override
public int getRenderId()
{
return ClientProxy.BASIC_RENDER_ID;
}
}