Advertisement
Guest User

Untitled

a guest
Aug 14th, 2013
57
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package co.uk.silvania.roads.block.tess.renderers;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import net.minecraft.block.Block;
  6. import net.minecraft.client.Minecraft;
  7. import net.minecraft.client.renderer.RenderBlocks;
  8. import net.minecraft.client.renderer.Tessellator;
  9. import net.minecraft.util.ResourceLocation;
  10. import net.minecraft.world.IBlockAccess;
  11. import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
  12. import cpw.mods.fml.relauncher.Side;
  13. import cpw.mods.fml.relauncher.SideOnly;
  14.  
  15. public class ShortRampRenderer implements ISimpleBlockRenderingHandler {
  16.  
  17. @Override
  18. public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
  19.  
  20. }
  21.  
  22. @Override
  23. @SideOnly(Side.CLIENT)
  24. public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
  25. Tessellator tess = Tessellator.instance;
  26. GL11.glPushMatrix();
  27. GL11.glTranslated(0, 1, 1);
  28. tess.addVertexWithUV(0, 1, 1, 0, 0);
  29. tess.addVertexWithUV(1, 1, 1, 0, 1);
  30. tess.addVertexWithUV(1, 1, 0, 1, 1);
  31. tess.addVertexWithUV(0, 1, 0, 1, 0);
  32.  
  33. tess.addVertexWithUV(0, 0, 1, 0, 0);
  34. tess.addVertexWithUV(0, 1, 1, 0, 1);
  35. tess.addVertexWithUV(0, 1, 0, 1, 1);
  36. tess.addVertexWithUV(0, 0, 0, 1, 0);
  37. GL11.glPopMatrix();
  38. return true;
  39. }
  40.  
  41. @Override
  42. public boolean shouldRender3DInInventory() {
  43. return false;
  44. }
  45.  
  46. @Override
  47. public int getRenderId() {
  48. return 0;
  49. }
  50. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement