Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.creativemd.randomadditions.client.rendering;
- import net.minecraft.block.Block;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.renderer.ItemRenderer;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.RenderBlocks;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.texture.TextureManager;
- import net.minecraft.client.renderer.texture.TextureMap;
- import net.minecraft.client.renderer.texture.TextureUtil;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.item.ItemBlock;
- import net.minecraft.item.ItemCloth;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.IIcon;
- import net.minecraft.util.MathHelper;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.Vec3;
- import net.minecraftforge.client.ForgeHooksClient;
- import net.minecraftforge.common.util.ForgeDirection;
- import org.lwjgl.opengl.GL11;
- import org.lwjgl.opengl.GL12;
- import com.creativemd.randomadditions.common.energy.machine.CubeObject;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class RenderHelper3D {
- public static Minecraft mc = Minecraft.getMinecraft();
- public static RenderBlocks renderer = RenderBlocks.getInstance();
- public static void renderBlock(Block block, double x, double y, double z, double width, double height, double length, double rotateX, double rotateY, double rotateZ)
- {
- GL11.glPushMatrix();
- GL11.glTranslated(x, y, z);
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glScaled(width, height, length);
- GL11.glRotated(rotateX, 1, 0, 0);
- GL11.glRotated(rotateY, 0, 1, 0);
- GL11.glRotated(rotateZ, 0, 0, 1);
- RenderHelper3D.renderBlock(block);
- GL11.glPopMatrix();
- }
- public static void renderBlock(Block block)
- {
- renderBlock(block, 0);
- }
- public static void renderBlock(Block block, int meta)
- {
- Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
- renderer.useInventoryTint = false;
- float f5 = 1F;
- renderer.renderBlockAsItem(block, meta, f5);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment