/// <summary> /// Draws the screen and all the components in it. /// </summary> public override void DrawScreen(int par1, int par2, float par3) { RenderSkybox(par1, par2, par3); Tessellator tessellator = Tessellator.Instance; int c = 274; int i = Width / 2 - c / 2; sbyte byte0 = 30; DrawGradientRect(0, 0, Width, Height, 0x80fffff, 0xffffff); DrawGradientRect(0, 0, Width, Height, 0, 0x8000000); //GL.BindTexture(TextureTarget.Texture2D, Mc.RenderEngineOld.GetTexture("title.mclogo.png")); RenderEngine.Instance.BindTexture("title.mclogo.png"); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); if ((double)UpdateCounter < 0.0001D) { DrawTexturedModalRect(i + 0, byte0 + 0, 0, 0, 99, 44); DrawTexturedModalRect(i + 99, byte0 + 0, 129, 0, 27, 44); DrawTexturedModalRect(i + 99 + 26, byte0 + 0, 126, 0, 3, 44); DrawTexturedModalRect(i + 99 + 26 + 3, byte0 + 0, 99, 0, 26, 44); DrawTexturedModalRect(i + 155, byte0 + 0, 0, 45, 155, 44); } else { DrawTexturedModalRect(i + 0, byte0 + 0, 0, 0, 155, 44); DrawTexturedModalRect(i + 155, byte0 + 0, 0, 45, 155, 44); } /* * tessellator.SetColorOpaque_I(0xffffff); * GL.PushMatrix(); * GL.Translate(Width / 2 + 90, 70F, 0.0F); * GL.Rotate(-20F, 0.0F, 0.0F, 1.0F);*/ float f = 1.8F - MathHelper2.Abs(MathHelper2.Sin(((float)(JavaHelper.CurrentTimeMillis() % 1000L) / 1000F) * (float)Math.PI * 2.0F) * 0.1F); f = (f * 100F) / (float)(FontRenderer.GetStringWidth(SplashText) + 32); //GL.Scale(f, f, f); DrawCenteredString(FontRenderer, SplashText, 300, 80, 0xffff00); //GL.PopMatrix(); DrawString(FontRenderer, Minecraft.GetMinecraftTitle(), 2, Height - FontRenderer.FontHeight, 0xffffff); string s = "Copyright Mojang AB. Do not distribute!"; DrawString(FontRenderer, s, Width - (int)FontRenderer.GetStringWidth(s) - 2, Height - FontRenderer.FontHeight, 0xffffff); base.DrawScreen(par1, par2, par3); }
/// <summary> /// gets the way this piston should face for that entity that placed it. /// </summary> private static int DetermineOrientation(World par0World, int par1, int par2, int par3, EntityPlayer par4EntityPlayer) { if (MathHelper2.Abs((float)par4EntityPlayer.PosX - (float)par1) < 2.0F && MathHelper2.Abs((float)par4EntityPlayer.PosZ - (float)par3) < 2.0F) { double d = (par4EntityPlayer.PosY + 1.8200000000000001D) - (double)par4EntityPlayer.YOffset; if (d - (double)par2 > 2D) { return(1); } if ((double)par2 - d > 0.0F) { return(0); } } int i = MathHelper2.Floor_double((double)((par4EntityPlayer.RotationYaw * 4F) / 360F) + 0.5D) & 3; if (i == 0) { return(2); } if (i == 1) { return(5); } if (i == 2) { return(3); } return(i != 3 ? 0 : 4); }
/// <summary> /// Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons /// use this to react to sunlight and start to burn. /// </summary> public override void OnLivingUpdate() { base.OnLivingUpdate(); Field_21088_b = Field_21089_a; Field_21086_f = Field_21087_c; Field_21084_h = Field_21085_g; LastTentacleAngle = TentacleAngle; Field_21085_g += Field_21080_l; if (Field_21085_g > ((float)Math.PI * 2F)) { Field_21085_g -= ((float)Math.PI * 2F); if (Rand.Next(10) == 0) { Field_21080_l = (1.0F / (Rand.NextFloat() + 1.0F)) * 0.2F; } } if (IsInWater()) { if (Field_21085_g < (float)Math.PI) { float f = Field_21085_g / (float)Math.PI; TentacleAngle = MathHelper2.Sin(f * f * (float)Math.PI) * (float)Math.PI * 0.25F; if ((double)f > 0.75D) { RandomMotionSpeed = 1.0F; Field_21079_m = 1.0F; } else { Field_21079_m = Field_21079_m * 0.8F; } } else { TentacleAngle = 0.0F; RandomMotionSpeed = RandomMotionSpeed * 0.9F; Field_21079_m = Field_21079_m * 0.99F; } if (!WorldObj.IsRemote) { MotionX = RandomMotionVecX * RandomMotionSpeed; MotionY = RandomMotionVecY * RandomMotionSpeed; MotionZ = RandomMotionVecZ * RandomMotionSpeed; } float f1 = MathHelper2.Sqrt_double(MotionX * MotionX + MotionZ * MotionZ); RenderYawOffset += ((-(float)Math.Atan2(MotionX, MotionZ) * 180F) / (float)Math.PI - RenderYawOffset) * 0.1F; RotationYaw = RenderYawOffset; Field_21087_c = Field_21087_c + (float)Math.PI * Field_21079_m * 1.5F; Field_21089_a += ((-(float)Math.Atan2(f1, MotionY) * 180F) / (float)Math.PI - Field_21089_a) * 0.1F; } else { TentacleAngle = MathHelper2.Abs(MathHelper2.Sin(Field_21085_g)) * (float)Math.PI * 0.25F; if (!WorldObj.IsRemote) { MotionX = 0.0F; MotionY -= 0.080000000000000002F; MotionY *= 0.98000001907348633F; MotionZ = 0.0F; } Field_21089_a += (-90F - Field_21089_a) * 0.02F; } }