mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-14 01:04:05 +00:00
All devs and contributors should use the provided formatter settings. If your IDE does not support the format, the rules are simple, it is the default java formatting rules, with 200char line lengths and 1 extra line after class definitions.
58 lines
1.5 KiB
Java
58 lines
1.5 KiB
Java
package com.cricketcraft.chisel.client.render;
|
|
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.client.renderer.RenderBlocks;
|
|
import net.minecraft.world.IBlockAccess;
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
import com.cricketcraft.chisel.block.BlockMarbleStairs;
|
|
import com.cricketcraft.chisel.utils.Drawing;
|
|
|
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
|
|
public class BlockMarbleStairsRenderer implements ISimpleBlockRenderingHandler {
|
|
|
|
public static int id;
|
|
|
|
public BlockMarbleStairsRenderer() {
|
|
id = RenderingRegistry.getNextAvailableRenderId();
|
|
}
|
|
|
|
@Override
|
|
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
|
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
|
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);
|
|
Drawing.drawBlock(block, meta, renderer);
|
|
renderer.setRenderBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
|
|
Drawing.drawBlock(block, meta, renderer);
|
|
}
|
|
|
|
@Override
|
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) {
|
|
if (blck == null || !(blck instanceof BlockMarbleStairs))
|
|
return false;
|
|
BlockMarbleStairs block = (BlockMarbleStairs) blck;
|
|
|
|
renderer.renderBlockStairs(block, x, y, z);
|
|
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public boolean shouldRender3DInInventory(int renderId) {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public int getRenderId() {
|
|
return id;
|
|
}
|
|
|
|
public int getRenderBlockPass() {
|
|
return 1;
|
|
}
|
|
|
|
}
|