Guest User

Untitled

a guest
Oct 23rd, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.19 KB | None | 0 0
  1. package com.creativemd.randomadditions.client.rendering;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.client.Minecraft;
  5. import net.minecraft.client.renderer.ItemRenderer;
  6. import net.minecraft.client.renderer.OpenGlHelper;
  7. import net.minecraft.client.renderer.RenderBlocks;
  8. import net.minecraft.client.renderer.Tessellator;
  9. import net.minecraft.client.renderer.entity.RenderManager;
  10. import net.minecraft.client.renderer.texture.TextureManager;
  11. import net.minecraft.client.renderer.texture.TextureMap;
  12. import net.minecraft.client.renderer.texture.TextureUtil;
  13. import net.minecraft.entity.item.EntityItem;
  14. import net.minecraft.item.ItemBlock;
  15. import net.minecraft.item.ItemCloth;
  16. import net.minecraft.item.ItemStack;
  17. import net.minecraft.util.IIcon;
  18. import net.minecraft.util.MathHelper;
  19. import net.minecraft.util.ResourceLocation;
  20. import net.minecraft.util.Vec3;
  21. import net.minecraftforge.client.ForgeHooksClient;
  22. import net.minecraftforge.common.util.ForgeDirection;
  23.  
  24. import org.lwjgl.opengl.GL11;
  25. import org.lwjgl.opengl.GL12;
  26.  
  27. import com.creativemd.randomadditions.common.energy.machine.CubeObject;
  28.  
  29. import cpw.mods.fml.relauncher.Side;
  30. import cpw.mods.fml.relauncher.SideOnly;
  31.  
  32. @SideOnly(Side.CLIENT)
  33. public class RenderHelper3D {
  34.    
  35.     public static Minecraft mc = Minecraft.getMinecraft();
  36.     public static RenderBlocks renderer = RenderBlocks.getInstance();
  37.    
  38.     public static void renderBlock(Block block, double x, double y, double z, double width, double height, double length, double rotateX, double rotateY, double rotateZ)
  39.     {
  40.         GL11.glPushMatrix();
  41.         GL11.glTranslated(x, y, z);
  42.         GL11.glEnable(GL12.GL_RESCALE_NORMAL);
  43.         GL11.glScaled(width, height, length);
  44.         GL11.glRotated(rotateX, 1, 0, 0);
  45.         GL11.glRotated(rotateY, 0, 1, 0);
  46.         GL11.glRotated(rotateZ, 0, 0, 1);
  47.         RenderHelper3D.renderBlock(block);
  48.         GL11.glPopMatrix();
  49.     }
  50.    
  51.     public static void renderBlock(Block block)
  52.     {
  53.         renderBlock(block, 0);
  54.     }
  55.    
  56.     public static void renderBlock(Block block, int meta)
  57.     {
  58.         Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
  59.         renderer.useInventoryTint = false;
  60.         float f5 = 1F;
  61.         renderer.renderBlockAsItem(block, meta, f5);
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment