Search in sources :

Example 16 with RenderManager

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

the class NicknameGUI method drawEntityOnScreen.

private static void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent) {
    GlStateManager.enableColorMaterial();
    GlStateManager.pushMatrix();
    GlStateManager.translate((float) posX, (float) posY, 50.0F);
    GlStateManager.scale((float) (-scale), (float) scale, (float) scale);
    GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
    float f = ent.renderYawOffset;
    float f1 = ent.rotationYaw;
    float f2 = ent.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((double) (mouseY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
    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 = Minecraft.getMinecraft().getRenderManager();
    rendermanager.setPlayerViewY(180.0F);
    // Fix player model being dependent on environmental lighting.
    GlStateManager.disableLighting();
    rendermanager.setRenderShadow(false);
    rendermanager.renderEntity(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
    rendermanager.setRenderShadow(true);
    ent.renderYawOffset = f;
    ent.rotationYaw = f1;
    ent.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 17 with RenderManager

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

the class ParticleInfectedGuardianAppearance method renderParticle.

@Override
public void renderParticle(BufferBuilder worldrenderer, Entity entity, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
    if (this.entity != null) {
        RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
        rendermanager.setRenderPosition(Particle.interpPosX, Particle.interpPosY, Particle.interpPosZ);
        float f = 0.42553192F;
        float f1 = (this.particleAge + partialTicks) / this.particleMaxAge;
        GlStateManager.depthMask(true);
        GlStateManager.enableBlend();
        GlStateManager.enableDepth();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
        float f2 = 240.0F;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, f2, f2);
        GlStateManager.pushMatrix();
        float f3 = 0.05F + 0.5F * MathHelper.sin(f1 * (float) Math.PI);
        GlStateManager.color(1.0F, 1.0F, 1.0F, f3);
        GlStateManager.translate(0.0F, 1.8F, 0.0F);
        GlStateManager.rotate(180.0F - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(60.0F - 150.0F * f1 - entity.rotationPitch, 1.0F, 0.0F, 0.0F);
        GlStateManager.translate(0.0F, -0.4F, -1.5F);
        GlStateManager.scale(f, f, f);
        this.entity.rotationYaw = this.entity.prevRotationYaw = 0.0F;
        this.entity.rotationYawHead = this.entity.prevRotationYawHead = 0.0F;
        rendermanager.renderEntity(this.entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks, false);
        GlStateManager.popMatrix();
        GlStateManager.enableDepth();
    }
}
Also used : RenderManager(net.minecraft.client.renderer.entity.RenderManager)

Example 18 with RenderManager

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

the class ClientEventHandler method onRenderWorldLast.

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onRenderWorldLast(RenderWorldLastEvent event) {
    RenderManager manager = this.mc.getRenderManager();
    if (this.mc.world != null) {
        if (!ClientEventHandler.RECEIVER_RENDER_POS.isEmpty()) {
            for (BlockPos renderPos : ClientEventHandler.RECEIVER_RENDER_POS) {
                TileEntity tile = this.mc.world.getTileEntity(renderPos);
                GlStateManager.pushMatrix();
                GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
                if (tile != null && tile instanceof TileEntityDarkEnergyReceiver) {
                    TileEntityDarkEnergyReceiver der = (TileEntityDarkEnergyReceiver) tile;
                    der.multiBlockClientLists.forEach((pos, state) -> MultiblockRendererUtils.renderBlock(renderPos.getX() - manager.renderPosX, renderPos.getY() - manager.renderPosY, renderPos.getZ() - manager.renderPosZ, pos, state));
                    der.multiTileClientLists.forEach((pos, tile2) -> MultiblockRendererUtils.renderTile(renderPos.getX() - manager.renderPosX, renderPos.getY() - manager.renderPosY, renderPos.getZ() - manager.renderPosZ, pos, tile2));
                }
            }
            GlStateManager.popMatrix();
        }
        if (!ClientEventHandler.WASTE_RENDER_POS.isEmpty()) {
            for (BlockPos renderPos : ClientEventHandler.WASTE_RENDER_POS) {
                TileEntity tile = this.mc.world.getTileEntity(renderPos);
                GlStateManager.pushMatrix();
                GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
                if (tile != null && tile instanceof TileEntityNuclearWasteGenerator) {
                    TileEntityNuclearWasteGenerator generator = (TileEntityNuclearWasteGenerator) tile;
                    generator.multiBlockClientLists.forEach((pos, state) -> MultiblockRendererUtils.renderBlock(renderPos.getX() - manager.renderPosX, renderPos.getY() - manager.renderPosY, renderPos.getZ() - manager.renderPosZ, pos, state));
                    generator.multiTileClientLists.forEach(pos -> MultiblockRendererUtils.renderTankTile(renderPos.getX() - manager.renderPosX, renderPos.getY() - manager.renderPosY, renderPos.getZ() - manager.renderPosZ, pos));
                }
                GlStateManager.popMatrix();
            }
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityNuclearWasteGenerator(stevekung.mods.moreplanets.planets.nibiru.tileentity.TileEntityNuclearWasteGenerator) TileEntityDarkEnergyReceiver(stevekung.mods.moreplanets.tileentity.TileEntityDarkEnergyReceiver) BlockPos(net.minecraft.util.math.BlockPos) RenderManager(net.minecraft.client.renderer.entity.RenderManager) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 19 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();
        ClientRendererUtil.renderLightState(false);
    }
    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)

Example 20 with RenderManager

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

the class VenusModuleClient method preInit.

@Override
public void preInit(FMLPreInitializationEvent event) {
    addPlanetVariants("venus", "venus_rock_0", "venus_rock_1", "venus_rock_2", "venus_rock_3", "dungeon_brick_venus_1", "dungeon_brick_venus_2", "venus_ore_aluminum", "venus_ore_copper", "venus_ore_galena", "venus_ore_quartz", "venus_ore_silicon", "venus_ore_tin", "lead_block");
    addPlanetVariants("thermal_padding_t2", "thermal_helm_t2", "thermal_chestplate_t2", "thermal_leggings_t2", "thermal_boots_t2");
    addPlanetVariants("basic_item_venus", "shield_controller", "ingot_lead", "radioisotope_core", "thermal_fabric");
    addPlanetVariants("web_torch", "web_torch_0", "web_torch_1");
    MinecraftForge.EVENT_BUS.register(this);
    RenderingRegistry.registerEntityRenderingHandler(EntityJuicer.class, (RenderManager manager) -> new RenderJuicer(manager));
    RenderingRegistry.registerEntityRenderingHandler(EntityEntryPodVenus.class, (RenderManager manager) -> new RenderEntryPodVenus(manager));
    RenderingRegistry.registerEntityRenderingHandler(EntitySpiderQueen.class, (RenderManager manager) -> new RenderSpiderQueen(manager));
    RenderingRegistry.registerEntityRenderingHandler(EntityWebShot.class, (RenderManager manager) -> new RenderWebShot(manager));
}
Also used : RenderWebShot(micdoodle8.mods.galacticraft.planets.venus.client.render.entity.RenderWebShot) RenderEntryPodVenus(micdoodle8.mods.galacticraft.planets.venus.client.render.entity.RenderEntryPodVenus) RenderJuicer(micdoodle8.mods.galacticraft.planets.venus.client.render.entity.RenderJuicer) RenderSpiderQueen(micdoodle8.mods.galacticraft.planets.venus.client.render.entity.RenderSpiderQueen) 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