///<summary> /// Used for easily adding entity-dependent animations. The second and third float params here are the same second /// and third as in the setRotationAngles method. ///</summary> public void SetLivingAnimations(EntityLiving par1EntityLiving, float par2, float par3, float par4) { EntityIronGolem entityirongolem = (EntityIronGolem)par1EntityLiving; int i = entityirongolem.Func_48114_ab(); if (i > 0) { Field_48233_c.RotateAngleX = -2F + 1.5F * Func_48228_a((float)i - par4, 10F); Field_48230_d.RotateAngleX = -2F + 1.5F * Func_48228_a((float)i - par4, 10F); } else { int j = entityirongolem.Func_48117_D_(); if (j > 0) { Field_48233_c.RotateAngleX = -0.8F + 0.025F * Func_48228_a(j, 70F); Field_48230_d.RotateAngleX = 0.0F; } else { Field_48233_c.RotateAngleX = (-0.2F + 1.5F * Func_48228_a(par2, 13F)) * par3; Field_48230_d.RotateAngleX = (-0.2F - 1.5F * Func_48228_a(par2, 13F)) * par3; } } }
protected virtual void Func_48419_a(EntityIronGolem par1EntityIronGolem, float par2) { base.RenderEquippedItems(par1EntityIronGolem, par2); if (par1EntityIronGolem.Func_48117_D_() == 0) { return; } else { //GL.Enable(EnableCap.RescaleNormal); //GL.PushMatrix(); //GL.Rotate(5F + (180F * Field_48422_c.Field_48233_c.RotateAngleX) / (float)Math.PI, 1.0F, 0.0F, 0.0F); //GL.Translate(-0.6875F, 1.25F, -0.9375F); //GL.Rotate(90F, 1.0F, 0.0F, 0.0F); float f = 0.8F; //GL.Scale(f, -f, f); int i = par1EntityIronGolem.GetBrightnessForRender(par2); int j = i % 0x10000; int k = i / 0x10000; OpenGlHelper.SetLightmapTextureCoords(OpenGlHelper.LightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); LoadTexture("/terrain.png"); RenderBlocks.RenderBlockAsItem(Block.PlantRed, 0, 1.0F); //GL.PopMatrix(); //GL.Disable(EnableCap.RescaleNormal); return; } }
/// <summary> /// Returns whether the EntityAIBase should begin execution. /// </summary> public override bool ShouldExecute() { if (TheVillager.GetGrowingAge() >= 0) { return(false); } if (!TheVillager.WorldObj.IsDaytime()) { return(false); } List <Entity> list = TheVillager.WorldObj.GetEntitiesWithinAABB(typeof(net.minecraft.src.EntityIronGolem), TheVillager.BoundingBox.Expand(6, 2, 6)); if (list.Count == 0) { return(false); } IEnumerator <Entity> iterator = list.GetEnumerator(); do { if (!iterator.MoveNext()) { break; } Entity entity = iterator.Current; EntityIronGolem entityirongolem = (EntityIronGolem)entity; if (entityirongolem.Func_48117_D_() <= 0) { continue; } TheGolem = entityirongolem; break; }while (true); return(TheGolem != null); }
/// <summary> /// Returns whether an in-progress EntityAIBase should continue executing /// </summary> public override bool ContinueExecuting() { return(TheGolem.Func_48117_D_() > 0); }