Search in sources :

Example 36 with RenderManager

use of net.minecraft.client.renderer.entity.RenderManager in project pnc-repressurized by TeamPneumatic.

the class RenderAssemblyIOUnit method renderModel.

@Override
void renderModel(TileEntityAssemblyIOUnit te, float partialTicks) {
    if (te != null) {
        float[] renderAngles = new float[5];
        for (int i = 0; i < 5; i++) {
            renderAngles[i] = te.oldAngles[i] + (te.angles[i] - te.oldAngles[i]) * partialTicks;
        }
        EntityItem ghostEntityItem = null;
        if (!te.getPrimaryInventory().getStackInSlot(0).isEmpty()) {
            ghostEntityItem = new EntityItem(te.getWorld());
            ghostEntityItem.hoverStart = 0.0F;
            ghostEntityItem.setItem(te.getPrimaryInventory().getStackInSlot(0));
        }
        RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
        boolean fancySetting = renderManager.options.fancyGraphics;
        renderManager.options.fancyGraphics = true;
        model.renderModel(0.0625F, renderAngles, te.oldClawProgress + (te.clawProgress - te.oldClawProgress) * partialTicks, ghostEntityItem);
        renderManager.options.fancyGraphics = fancySetting;
    } else {
        model.renderModel(0.0625F, new float[] { 0, 0, 35, 55, 0 }, 0, null);
    }
}
Also used : RenderManager(net.minecraft.client.renderer.entity.RenderManager) EntityItem(net.minecraft.entity.item.EntityItem)

Example 37 with RenderManager

use of net.minecraft.client.renderer.entity.RenderManager in project pnc-repressurized by TeamPneumatic.

the class ModelChargingStation method renderModel.

public void renderModel(float scale, boolean renderChargePad, EntityItem ghostEntityItem) {
    if (renderChargePad) {
        shape3.render(scale);
        shape4.render(scale);
        shape5.render(scale);
        shape6.render(scale);
        shape7.render(scale);
        shape8.render(scale);
        shape9.render(scale);
        shape10.render(scale);
        shape11.render(scale);
        shape12.render(scale);
        shape13.render(scale);
        shape14.render(scale);
        shape15.render(scale);
        shape16.render(scale);
    }
    if (ghostEntityItem != null) {
        if (customRenderItem == null) {
            customRenderItem = new AbstractModelRenderer.NoBobItemRenderer();
        }
        GlStateManager.translate(0, 1.25f, 0);
        GlStateManager.scale(1.0F, -1F, -1F);
        RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
        boolean fancySetting = renderManager.options.fancyGraphics;
        renderManager.options.fancyGraphics = true;
        customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
        renderManager.options.fancyGraphics = fancySetting;
    }
}
Also used : AbstractModelRenderer(me.desht.pneumaticcraft.client.render.tileentity.AbstractModelRenderer) RenderManager(net.minecraft.client.renderer.entity.RenderManager)

Example 38 with RenderManager

use of net.minecraft.client.renderer.entity.RenderManager in project ct.js by ChatTriggers.

the class Tessellator method begin.

/**
 * Begin drawing with the Tessellator.
 *
 * @see com.chattriggers.ctjs.minecraft.libs.renderer.Shape#setDrawMode(int)
 * @param drawMode the GL draw mode
 * @param textured if the Tessellator is textured
 * @return the Tessellator to allow for method chaining
 */
public Tessellator begin(int drawMode, boolean textured) {
    GlStateManager.pushMatrix();
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    RenderManager renderManager = Client.getMinecraft().getRenderManager();
    GlStateManager.translate(-renderManager.viewerPosX, -renderManager.viewerPosY, -renderManager.viewerPosZ);
    this.worldRenderer.begin(drawMode, textured ? DefaultVertexFormats.POSITION_TEX : DefaultVertexFormats.POSITION);
    this.firstVertex = true;
    this.began = true;
    return this;
}
Also used : RenderManager(net.minecraft.client.renderer.entity.RenderManager)

Example 39 with RenderManager

use of net.minecraft.client.renderer.entity.RenderManager in project ct.js by ChatTriggers.

the class Renderer method drawPlayer.

/**
 * Render the player model on to the screen
 *
 * @param player the player to render
 * @param x   the x position on the screen
 * @param y   the y position on the screen
 * @param rotate whether or not the drawn player should rotate
 */
public static void drawPlayer(Object player, int x, int y, boolean rotate) {
    float mouseX = -30;
    float mouseY = 0;
    EntityLivingBase ent = Player.getPlayer();
    if (player instanceof PlayerMP)
        ent = ((PlayerMP) player).getPlayer();
    GlStateManager.enableColorMaterial();
    RenderHelper.enableStandardItemLighting();
    float f = ent.renderYawOffset;
    float f1 = ent.rotationYaw;
    float f2 = ent.rotationPitch;
    float f3 = ent.prevRotationYawHead;
    float f4 = ent.rotationYawHead;
    GlStateManager.translate((float) x, (float) y, 50.0F);
    GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
    GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-45.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-((float) Math.atan((double) (mouseY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
    if (!rotate) {
        ent.renderYawOffset = (float) Math.atan((double) (mouseX / 40.0F)) * 20.0F;
        ent.rotationYaw = (float) Math.atan((double) (mouseX / 40.0F)) * 40.0F;
        ent.rotationPitch = -((float) Math.atan((double) (mouseY / 40.0F))) * 20.0F;
        ent.rotationYawHead = ent.rotationYaw;
        ent.prevRotationYawHead = ent.rotationYaw;
    }
    GlStateManager.translate(0.0F, 0.0F, 0.0F);
    RenderManager rendermanager = Client.getMinecraft().getRenderManager();
    rendermanager.setPlayerViewY(180.0F);
    rendermanager.setRenderShadow(false);
    rendermanager.renderEntityWithPosYaw(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
    rendermanager.setRenderShadow(true);
    ent.renderYawOffset = f;
    ent.rotationYaw = f1;
    ent.rotationPitch = f2;
    ent.prevRotationYawHead = f3;
    ent.rotationYawHead = f4;
    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableRescaleNormal();
    GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GlStateManager.disableTexture2D();
    GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
    GlStateManager.popMatrix();
    GlStateManager.pushMatrix();
}
Also used : EntityLivingBase(net.minecraft.entity.EntityLivingBase) PlayerMP(com.chattriggers.ctjs.minecraft.wrappers.objects.PlayerMP) RenderManager(net.minecraft.client.renderer.entity.RenderManager)

Example 40 with RenderManager

use of net.minecraft.client.renderer.entity.RenderManager in project Armourers-Workshop by RiskyKen.

the class RenderBlockMannequin method renderEquippedItem.

private void renderEquippedItem(MannequinFakePlayer fakePlayer, ItemStack stack, ModelMannequin targetBiped, int slot, byte[] extraColours, double distance, BipedRotations rots) {
    Item targetItem = stack.getItem();
    RenderManager rm = RenderManager.instance;
    slot = slot % 7;
    String[] slotName = { "head", "chest", "legs", "unused", "feet", "rightArm", "leftArm" };
    mc.mcProfiler.startSection(slotName[slot]);
    GL11.glPushMatrix();
    boolean isChild = targetBiped.isChild;
    if (isChild) {
        ModelHelper.enableChildModelScale(slot == 0, SCALE);
    }
    targetBiped.isChild = false;
    switch(slot) {
        case 0:
            renderItems.renderHeadStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
            if (rots != null) {
                rots.applyRotationsToBiped(targetBiped);
            }
            break;
        case 1:
            renderItems.renderChestStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
            if (rots != null) {
                rots.applyRotationsToBiped(targetBiped);
            }
            break;
        case 2:
            renderItems.renderLegsStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
            if (rots != null) {
                rots.applyRotationsToBiped(targetBiped);
            }
            break;
        case 3:
            renderItems.renderFeetStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
            if (rots != null) {
                rots.applyRotationsToBiped(targetBiped);
            }
            break;
        case 4:
            renderItems.renderRightArmStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
            if (rots != null) {
                rots.applyRotationsToBiped(targetBiped);
            }
            break;
        case 5:
            renderItems.renderLeftArmStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
            if (rots != null) {
                rots.applyRotationsToBiped(targetBiped);
            }
            break;
        case 6:
            renderItems.renderWingsStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
            break;
    }
    targetBiped.isChild = isChild;
    if (isChild) {
        ModelHelper.disableChildModelScale();
    }
    GL11.glPopMatrix();
    mc.mcProfiler.endSection();
}
Also used : Item(net.minecraft.item.Item) RenderItem(net.minecraft.client.renderer.entity.RenderItem) EntityItem(net.minecraft.entity.item.EntityItem) RenderManager(net.minecraft.client.renderer.entity.RenderManager)

Aggregations

RenderManager (net.minecraft.client.renderer.entity.RenderManager)45 Tessellator (net.minecraft.client.renderer.Tessellator)8 FontRenderer (net.minecraft.client.gui.FontRenderer)7 InvokeEvent (cc.hyperium.event.InvokeEvent)4 Minecraft (net.minecraft.client.Minecraft)4 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)3 WorldRenderer (net.minecraft.client.renderer.WorldRenderer)3 Render (net.minecraft.client.renderer.entity.Render)3 EntityLivingBase (net.minecraft.entity.EntityLivingBase)3 EntityItem (net.minecraft.entity.item.EntityItem)3 Field (java.lang.reflect.Field)2 EntityJuicer (micdoodle8.mods.galacticraft.planets.venus.entities.EntityJuicer)2 BufferBuilder (net.minecraft.client.renderer.BufferBuilder)2 RenderPlayer (net.minecraft.client.renderer.entity.RenderPlayer)2 TextureManager (net.minecraft.client.renderer.texture.TextureManager)2 Entity (net.minecraft.entity.Entity)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 ItemStack (net.minecraft.item.ItemStack)2 LayerBloodElytra (WayofTime.bloodmagic.client.render.LayerBloodElytra)1 IMixinThreadDownloadImageData (cc.hyperium.mixins.client.renderer.IMixinThreadDownloadImageData)1