2013-08-27 00:57:08 +02:00
|
|
|
package mekanism.client.render.block;
|
2013-04-28 21:23:08 +02:00
|
|
|
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.client.ClientProxy;
|
|
|
|
import mekanism.client.render.MekanismRenderer;
|
2013-04-28 21:23:08 +02:00
|
|
|
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)
|
|
|
|
{
|
2013-05-28 06:29:29 +02:00
|
|
|
MekanismRenderer.renderItem(renderer, metadata, block);
|
2013-04-28 21:23:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|