/// <summary> /// Called periodically by VillageCollection /// </summary> public virtual void Tick(int par1) { TickCounter = par1; RemoveDeadAndOutOfRangeDoors(); RemoveDeadAndOldAgressors(); if (par1 % 20 == 0) { UpdateNumVillagers(); } if (par1 % 30 == 0) { UpdateNumIronGolems(); } int i = NumVillagers / 16; if (NumIronGolems < i && VillageDoorInfoList.Count > 20 && WorldObj.Rand.Next(7000) == 0) { Vec3D vec3d = TryGetIronGolemSpawningLocation(MathHelper2.Floor_float(Center.PosX), MathHelper2.Floor_float(Center.PosY), MathHelper2.Floor_float(Center.PosZ), 2, 4, 2); if (vec3d != null) { EntityIronGolem entityirongolem = new EntityIronGolem(WorldObj); entityirongolem.SetPosition((float)vec3d.XCoord, (float)vec3d.YCoord, (float)vec3d.ZCoord); WorldObj.SpawnEntityInWorld(entityirongolem); NumIronGolems++; } } }
///<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; } }
protected virtual void Func_48420_a(EntityIronGolem par1EntityIronGolem, float par2, float par3, float par4) { base.RotateCorpse(par1EntityIronGolem, par2, par3, par4); if ((double)par1EntityIronGolem.Field_704_R < 0.01D) { return; } else { float f = 13F; float f1 = (par1EntityIronGolem.Field_703_S - par1EntityIronGolem.Field_704_R * (1.0F - par4)) + 6F; float f2 = (Math.Abs(f1 % f - f * 0.5F) - f * 0.25F) / (f * 0.25F); //GL.Rotate(6.5F * f2, 0.0F, 0.0F, 1.0F); 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> /// Resets the task /// </summary> public override void ResetTask() { TheGolem = null; TheVillager.GetNavigator().ClearPathEntity(); }
public virtual void Func_48421_a(EntityIronGolem par1EntityIronGolem, double par2, double par4, double par6, float par8, float par9) { base.DoRenderLiving(par1EntityIronGolem, par2, par4, par6, par8, par9); }