fCraft.World.EnableSandPhysics C# (CSharp) Method

EnableSandPhysics() public method

public EnableSandPhysics ( Player player, bool announce ) : void
player Player
announce bool
return void
        public void EnableSandPhysics( Player player, bool announce )
        {
            if ( sandPhysics == true ) {
                player.Message( "&WAlready enabled on this world" );
                return;
            }
            CheckIfPhysicsStarted();
            sandPhysics = true;
            if ( announce )
                Server.Message( "{0}&S enabled Sand Physics on {1}", player.ClassyName, ClassyName );
        }

Usage Example

Example #1
0
        public static void LoadOtherSettings(XElement el, World world)
        {
            XAttribute temp;

            if ((temp = el.Attribute("sandPhysics")) != null)
            {
                bool isPhy;
                if (bool.TryParse(temp.Value, out isPhy))
                {
                    world.EnableSandPhysics(Player.Console, false);
                }
            }
            if ((temp = el.Attribute("fireworkPhysics")) != null)
            {
                bool isPhy;
                if (bool.TryParse(temp.Value, out isPhy))
                {
                    world.EnableFireworkPhysics(Player.Console, false);
                }
            }
            if ((temp = el.Attribute("gunPhysics")) != null)
            {
                bool isPhy;
                if (bool.TryParse(temp.Value, out isPhy))
                {
                    world.EnableGunPhysics(Player.Console, false);
                }
            }
        }
All Usage Examples Of fCraft.World::EnableSandPhysics