Search in sources :

Example 26 with RenderManager

use of net.minecraft.client.renderer.entity.RenderManager in project DynamicSurroundings by OreCruncher.

the class LightLevelHUD method doTick.

@Override
public void doTick(final int tickRef) {
    if (!showHUD || tickRef == 0 || tickRef % 3 != 0)
        return;
    final RenderManager manager = Minecraft.getMinecraft().getRenderManager();
    updateLightInfo(manager, manager.viewerPosX, manager.viewerPosY, manager.viewerPosZ);
}
Also used : RenderManager(net.minecraft.client.renderer.entity.RenderManager)

Example 27 with RenderManager

use of net.minecraft.client.renderer.entity.RenderManager in project DynamicSurroundings by OreCruncher.

the class StormRenderer method setupForRender.

private static void setupForRender(@Nonnull final ResourceLocation r) {
    if (effectTexture != r) {
        if (worldrenderer == null) {
            worldrenderer = Tessellator.getInstance().getBuffer();
            final RenderManager manager = Minecraft.getMinecraft().getRenderManager();
            worldrenderer.setTranslation(-manager.viewerPosX, -manager.viewerPosY, -manager.viewerPosZ);
            locY = MathHelper.floor(manager.viewerPosY);
        }
        if (isDrawing)
            Tessellator.getInstance().draw();
        effectTexture = r;
        Minecraft.getMinecraft().getTextureManager().bindTexture(r);
        worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
        isDrawing = true;
    }
}
Also used : RenderManager(net.minecraft.client.renderer.entity.RenderManager)

Example 28 with RenderManager

use of net.minecraft.client.renderer.entity.RenderManager in project ForestryMC by ForestryMC.

the class RenderAnalyzer method render.

private void render(ItemStack itemstack, @Nullable World world, EnumFacing orientation, double x, double y, double z) {
    dummyEntityItem.world = world;
    model.render(orientation, (float) x, (float) y, (float) z);
    if (itemstack.isEmpty() || world == null) {
        return;
    }
    float renderScale = 1.0f;
    GlStateManager.pushMatrix();
    GlStateManager.translate((float) x, (float) y, (float) z);
    GlStateManager.translate(0.5f, 0.2f, 0.5f);
    GlStateManager.scale(renderScale, renderScale, renderScale);
    dummyEntityItem.setItem(itemstack);
    if (world.getTotalWorldTime() != lastTick) {
        lastTick = world.getTotalWorldTime();
        dummyEntityItem.onUpdate();
    }
    RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
    rendermanager.renderEntity(dummyEntityItem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F, false);
    GlStateManager.popMatrix();
}
Also used : RenderManager(net.minecraft.client.renderer.entity.RenderManager)

Example 29 with RenderManager

use of net.minecraft.client.renderer.entity.RenderManager in project MorePlanets by SteveKunG.

the class GuiListEntityFilterEntry method drawEntityOnScreen.

public static void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, Entity entity) {
    GlStateManager.enableColorMaterial();
    GlStateManager.pushMatrix();
    GlStateManager.translate(posX, posY, 50.0F);
    GlStateManager.scale(-scale, scale, scale);
    GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
    // float f = ent.renderYawOffset;
    float f1 = entity.rotationYaw;
    float f2 = entity.rotationPitch;
    // float f3 = ent.prevRotationYawHead;
    // float f4 = ent.rotationYawHead;
    GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-((float) Math.atan(mouseY / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
    // ent.renderYawOffset = (float)Math.atan((double)(mouseX / 40.0F)) * 20.0F;
    entity.rotationYaw = (float) Math.atan(mouseX / 40.0F) * 40.0F;
    entity.rotationPitch = -((float) Math.atan(mouseY / 40.0F)) * 20.0F;
    // ent.rotationYawHead = ent.rotationYaw;
    // ent.prevRotationYawHead = ent.rotationYaw;
    GlStateManager.translate(0.0F, 0.0F, 0.0F);
    RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
    rendermanager.setPlayerViewY(180.0F);
    rendermanager.setRenderShadow(false);
    rendermanager.renderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
    rendermanager.setRenderShadow(true);
    // ent.renderYawOffset = f;
    entity.rotationYaw = f1;
    entity.rotationPitch = f2;
    // ent.prevRotationYawHead = f3;
    // ent.rotationYawHead = f4;
    GlStateManager.popMatrix();
    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableRescaleNormal();
    GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GlStateManager.disableTexture2D();
    GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
Also used : RenderManager(net.minecraft.client.renderer.entity.RenderManager)

Example 30 with RenderManager

use of net.minecraft.client.renderer.entity.RenderManager in project MorePlanets by SteveKunG.

the class TileEntityJuicerEggRenderer method renderItem.

public static void renderItem(ItemCameraTransforms.TransformType type, boolean render) {
    GlStateManager.pushMatrix();
    GlStateManager.translate(0.5F, 1.35F, 0.5F);
    GlStateManager.scale(-1.0F, -1.0F, 1.0F);
    GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
    RenderManager manager = Minecraft.getMinecraft().getRenderManager();
    EntityJuicer juicer = new EntityJuicer(Minecraft.getMinecraft().world);
    manager.renderEntity(juicer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
    if (type != null && type == ItemCameraTransforms.TransformType.GUI || render) {
        GlStateManager.enableRescaleNormal();
        GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
        GlStateManager.disableTexture2D();
        GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
        GlStateManager.disableLighting();
        RenderUtils.enableLighting();
    }
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.popMatrix();
}
Also used : EntityJuicer(micdoodle8.mods.galacticraft.planets.venus.entities.EntityJuicer) 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