Package net.minecraft.entity

Examples of net.minecraft.entity.EntityLivingBase


    public static void setPositionList(WorldRenderer rend, int glRenderList)
    {
        GL11.glNewList(glRenderList + 3, GL11.GL_COMPILE);

        EntityLivingBase entitylivingbase = ClientProxyCore.mc.renderViewEntity;

        if (entitylivingbase != null)
        {
            if (rend.worldObj.provider instanceof WorldProviderMoon)
            {
View Full Code Here


            final double y = this.prevPosY + (this.posY - this.prevPosY) + y1;

            final double x2 = this.posX + x1;
            final double z2 = this.posZ + z1;

            EntityLivingBase riddenByEntity = this.riddenByEntity instanceof EntityLivingBase ? (EntityLivingBase)this.riddenByEntity : null;

            if (this.getLaunched())
            {
                Vector3 motionVec = new Vector3(x1, y1, z1);
                GalacticraftCore.proxy.spawnParticle("launchFlameLaunched", new Vector3(x2 + 0.4 - this.rand.nextDouble() / 10, y, z2 + 0.4 - this.rand.nextDouble() / 10), motionVec, new Object[] { riddenByEntity });
View Full Code Here

        double ymotion = linkedEntity instanceof EntityLivingBase ? linkedEntity.motionY + 0.078D : linkedEntity.motionY;
        double zmotion = linkedEntity.motionZ;
        data2 = (int) (MathHelper.sqrt_double(xmotion * xmotion + ymotion * ymotion + zmotion * zmotion) * 2000D);
        if (linkedEntity instanceof EntityLivingBase)
        {
          EntityLivingBase eLiving = (EntityLivingBase)linkedEntity;
          data0 = eLiving.hurtTime;
         
          //Calculate a "pulse rate" based on motion and taking damage
          this.pulseRate--;
          if (eLiving.hurtTime > this.lastHurttime) this.pulseRate += 100;
          this.lastHurttime = eLiving.hurtTime;
          if (eLiving.ridingEntity != null) data2 /= 4//reduced pulse effect if riding a vehicle
          else if (data2 > 1) this.pulseRate+=2;
          this.pulseRate += Math.max(data2 - pulseRate, 0) / 4;
          if (this.pulseRate > 2000) this.pulseRate = 2000;
          if (this.pulseRate < 400) this.pulseRate = 400;
          data2 = this.pulseRate / 10;
         
          data1 =  (int) (eLiving.getHealth() * 100 / eLiving.getMaxHealth());
          if (eLiving instanceof EntityPlayerMP)
          {
            data3 = ((EntityPlayerMP) eLiving).getFoodStats().getFoodLevel() * 5;
            GCPlayerStats stats = GCPlayerStats.get((EntityPlayerMP) eLiving);
            data4 = stats.airRemaining * 4096 + stats.airRemaining2;
View Full Code Here

                return;
            }

            if (par5Entity instanceof EntityLivingBase)
            {
                final EntityLivingBase livingEntity = (EntityLivingBase) par5Entity;

                par1World.playSoundEffect(par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F);

                for (int var5 = 0; var5 < 8; ++var5)
                {
                    par1World.spawnParticle("largesmoke", par2 + Math.random(), par3 + 0.2D + Math.random(), par4 + Math.random(), 0.0D, 0.0D, 0.0D);
                }

                if (!livingEntity.isBurning())
                {
                    livingEntity.setFire(2);
                }

                double var9 = par2 + 0.5F - livingEntity.posX;
                double var7;

                for (var7 = livingEntity.posZ - par4; var9 * var9 + var7 * var7 < 1.0E-4D; var7 = (Math.random() - Math.random()) * 0.01D)
                {
                    var9 = (Math.random() - Math.random()) * 0.01D;
                }

                livingEntity.knockBack(livingEntity, 1, var9, var7);
            }
        }
    }
View Full Code Here

                    if (movingobjectposition.entityHit.attackEntityFrom(damagesource, i1))
                    {
                        if (movingobjectposition.entityHit instanceof EntityLivingBase)
                        {
                            EntityLivingBase entitylivingbase = (EntityLivingBase) movingobjectposition.entityHit;

                            if (!this.worldObj.isRemote)
                            {
                                entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1);
                            }

                            if (this.knockbackStrength > 0)
                            {
                                f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
 
View Full Code Here

                RenderBlocks renderInventory = (RenderBlocks) data[0];
                MuseIconUtils.drawIconAt(0, 0, MPSItems.powerTool().getIconIndex(itemStack), colour);
                break;
            case EQUIPPED:
                RenderBlocks renderEquipped = (RenderBlocks) data[0];
                EntityLivingBase entityEquipped = (EntityLivingBase) data[1];

                if (entityEquipped instanceof EntityPlayer) {
                    model.setPoseForPlayer((EntityPlayer) entityEquipped, itemStack);
                } else {
                    model.setNeutralPose();
                }

                model.render(entityEquipped, 1, false, colour, glow);
                break;
            case FIRST_PERSON_MAP:
                EntityPlayer playerFirstPerson = (EntityPlayer) data[0];
                TextureManager engineFirstPerson = (TextureManager) data[1];
                MapData mapDataFirstPerson = (MapData) data[2];
                model.setPoseForPlayer(playerFirstPerson, itemStack);

                model.render(playerFirstPerson, 1, true, colour, glow);
                break;
            case EQUIPPED_FIRST_PERSON:
                RenderBlocks renderEquFP = (RenderBlocks) data[0];
                EntityLivingBase entityEquFP = (EntityLivingBase) data[1];
                if (entityEquFP instanceof EntityPlayer) {
                    model.setPoseForPlayer((EntityPlayer) entityEquFP, itemStack);
                } else {
                    model.setNeutralPose();
                }
View Full Code Here

    private void render(float partialTicks)
    {
        Minecraft.getMinecraft().mcProfiler.startSection(name + "-render");

        EntityLivingBase player = Minecraft.getMinecraft().renderViewEntity;
        EntityFX.interpPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks;
        EntityFX.interpPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks;
        EntityFX.interpPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;

        TextureUtils.bindAtlas(1);
View Full Code Here

                if(player != null)
                {
                    MovingObjectPosition mop = EntityHelper.getEntityLook(player, 4D, false, 1.0F);
                    if(mop != null && mop.entityHit != null && mop.entityHit instanceof EntityLivingBase)
                    {
                        EntityLivingBase living = (EntityLivingBase)mop.entityHit;

                        if(living instanceof EntityPlayerMP)
                        {
                            EntityPlayerMP player1 = (EntityPlayerMP)living;
View Full Code Here

                        if((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F)
                        {
                            GL11.glScalef(prevScaleMag, prevScaleMag, prevScaleMag);

                            EntityLivingBase renderView = Minecraft.getMinecraft().renderViewEntity;

                            info.prevState.entInstance.renderYawOffset = renderView.renderYawOffset;
                            info.prevState.entInstance.rotationYaw = renderView.rotationYaw;
                            info.prevState.entInstance.rotationPitch = renderView.rotationPitch;
                            info.prevState.entInstance.prevRotationYawHead = renderView.prevRotationYawHead;
                            info.prevState.entInstance.rotationYawHead = renderView.rotationYawHead;
                            renderTick = 1.0F;
                        }

                        info.prevModelInfo.forceRender(info.prevState.entInstance, 0.0D, 0.0D - event.entityPlayer.yOffset, 0.0D, f1, renderTick);

                        if(info.getMorphing())
                        {
                            float progress = ((float)info.morphProgress + Morph.proxy.tickHandlerClient.renderTick) / 10F;

                            GL11.glEnable(GL11.GL_BLEND);
                            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

                            GL11.glColor4f(1.0F, 1.0F, 1.0F, progress);

                            ResourceLocation resourceLoc = ObfHelper.invokeGetEntityTexture(info.prevModelInfo.getRenderer(), info.prevModelInfo.getRenderer().getClass(), info.prevState.entInstance);
                            String resourceDomain = ReflectionHelper.getPrivateValue(ResourceLocation.class, resourceLoc, ObfHelper.resourceDomain);
                            String resourcePath = ReflectionHelper.getPrivateValue(ResourceLocation.class, resourceLoc, ObfHelper.resourcePath);

                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, "morph", ObfHelper.resourceDomain);
                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, "textures/skin/morphskin.png", ObfHelper.resourcePath);

                            info.prevModelInfo.forceRender(info.prevState.entInstance, 0.0D, 0.0D - event.entityPlayer.yOffset, 0.0D, f1, renderTick);

                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, resourceDomain, ObfHelper.resourceDomain);
                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, resourcePath, ObfHelper.resourcePath);

                            GL11.glDisable(GL11.GL_BLEND);
                            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                        }

                        info.prevState.entInstance.renderYawOffset = ff2;
                        info.prevState.entInstance.rotationYaw = ff3;
                        info.prevState.entInstance.rotationPitch = ff4;
                        info.prevState.entInstance.prevRotationYawHead = ff5;
                        info.prevState.entInstance.rotationYawHead = ff6;
                    }
                }
                else
                {
                    if(info.nextModelInfo != null && info.morphProgress >= 70)
                    {
                        float ff2 = info.nextState.entInstance.renderYawOffset;
                        float ff3 = info.nextState.entInstance.rotationYaw;
                        float ff4 = info.nextState.entInstance.rotationPitch;
                        float ff5 = info.nextState.entInstance.prevRotationYawHead;
                        float ff6 = info.nextState.entInstance.rotationYawHead;

                        if((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F)
                        {
                            GL11.glScalef(nextScaleMag, nextScaleMag, nextScaleMag);

                            EntityLivingBase renderView = Minecraft.getMinecraft().renderViewEntity;

                            info.nextState.entInstance.prevRenderYawOffset = info.nextState.entInstance.renderYawOffset = renderView.renderYawOffset;
                            info.nextState.entInstance.rotationYaw = renderView.rotationYaw;
                            info.nextState.entInstance.rotationPitch = renderView.rotationPitch;
                            info.nextState.entInstance.prevRotationYawHead = renderView.prevRotationYawHead;
                            info.nextState.entInstance.rotationYawHead = renderView.rotationYawHead;
                            renderTick = 1.0F;
                        }

                        info.nextModelInfo.forceRender(info.nextState.entInstance, 0.0D, 0.0D - event.entityPlayer.yOffset, 0.0D, f1, renderTick);

                        if(info.getMorphing())
                        {
                            float progress = ((float)info.morphProgress - 70 + Morph.proxy.tickHandlerClient.renderTick) / 10F;

                            GL11.glEnable(GL11.GL_BLEND);
                            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

                            if(progress > 1.0F)
                            {
                                progress = 1.0F;
                            }
                            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F - progress);

                            ResourceLocation resourceLoc = ObfHelper.invokeGetEntityTexture(info.nextModelInfo.getRenderer(), info.nextModelInfo.getRenderer().getClass(), info.nextState.entInstance);
                            String resourceDomain = ReflectionHelper.getPrivateValue(ResourceLocation.class, resourceLoc, ObfHelper.resourceDomain);
                            String resourcePath = ReflectionHelper.getPrivateValue(ResourceLocation.class, resourceLoc, ObfHelper.resourcePath);

                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, "morph", ObfHelper.resourceDomain);
                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, "textures/skin/morphskin.png", ObfHelper.resourcePath);

                            info.nextModelInfo.forceRender(info.nextState.entInstance, 0.0D, 0.0D - event.entityPlayer.yOffset, 0.0D, f1, renderTick);

                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, resourceDomain, ObfHelper.resourceDomain);
                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, resourcePath, ObfHelper.resourcePath);

                            GL11.glDisable(GL11.GL_BLEND);
                            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                        }

                        info.nextState.entInstance.renderYawOffset = ff2;
                        info.nextState.entInstance.rotationYaw = ff3;
                        info.nextState.entInstance.rotationPitch = ff4;
                        info.nextState.entInstance.prevRotationYawHead = ff5;
                        info.nextState.entInstance.rotationYawHead = ff6;
                    }
                }
                if(info.prevModelInfo != null && info.nextModelInfo != null && info.morphProgress >= 10 && info.morphProgress < 70)
                {
                    float progress = ((float)info.morphProgress - 10F + Morph.proxy.tickHandlerClient.renderTick) / 60F;

                    float ff2 = info.prevState.entInstance.renderYawOffset;
                    float ff3 = info.prevState.entInstance.rotationYaw;
                    float ff4 = info.prevState.entInstance.rotationPitch;
                    float ff5 = info.prevState.entInstance.prevRotationYawHead;
                    float ff6 = info.prevState.entInstance.rotationYawHead;

                    float fff2 = info.nextState.entInstance.renderYawOffset;
                    float fff3 = info.nextState.entInstance.rotationYaw;
                    float fff4 = info.nextState.entInstance.rotationPitch;
                    float fff5 = info.nextState.entInstance.prevRotationYawHead;
                    float fff6 = info.nextState.entInstance.rotationYawHead;

                    if((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F)
                    {
                        GL11.glScalef(prevScaleMag + (nextScaleMag - prevScaleMag) * progress, prevScaleMag + (nextScaleMag - prevScaleMag) * progress, prevScaleMag + (nextScaleMag - prevScaleMag) * progress);

                        EntityLivingBase renderView = Minecraft.getMinecraft().renderViewEntity;

                        info.nextState.entInstance.renderYawOffset = info.prevState.entInstance.renderYawOffset = renderView.renderYawOffset;
                        info.nextState.entInstance.rotationYaw = info.prevState.entInstance.rotationYaw = renderView.rotationYaw;
                        info.nextState.entInstance.rotationPitch = info.prevState.entInstance.rotationPitch = renderView.rotationPitch;
                        info.nextState.entInstance.prevRotationYawHead = info.prevState.entInstance.prevRotationYawHead = renderView.prevRotationYawHead;
View Full Code Here

            }
            if(event.source.getEntity() instanceof EntityPlayerMP && event.entityLiving != event.source.getEntity())
            {
                EntityPlayerMP player = (EntityPlayerMP)event.source.getEntity();

                EntityLivingBase living = event.entityLiving;

                if(event.entityLiving instanceof EntityPlayerMP)
                {
                    EntityPlayerMP player1 = (EntityPlayerMP)event.entityLiving;

                    MorphInfo info = Morph.proxy.tickHandlerServer.getPlayerMorphInfo(player1);
                    if(info != null)
                    {
                        if(info.getMorphing())
                        {
                            living = info.prevState.entInstance;
                        }
                        else
                        {
                            living = info.nextState.entInstance;
                        }
                    }
                }

                if(EntityHelper.morphPlayer(player, living, true) && !(event.entityLiving instanceof EntityPlayerMP) && !(event.entityLiving instanceof IBossDisplayData))
                {
                    living.setDead();
                }
            }
            if(Morph.classToKillForFlight != null && Morph.classToKillForFlight.isInstance(event.entityLiving)|| Morph.classToKillForFlight == null &&  event.entityLiving instanceof EntityWither)
            {
                if(event.source.getEntity() instanceof EntityPlayerMP)
View Full Code Here

TOP

Related Classes of net.minecraft.entity.EntityLivingBase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.