fCraft.BlockFloat.PerformInternal C# (CSharp) Method

PerformInternal() protected method

protected PerformInternal ( ) : int
return int
        protected override int PerformInternal()
        {
            lock ( _world.SyncRoot ) {
                if ( _world.waterPhysics ) {
                    if ( _firstMove ) {
                        if ( _world.Map.GetBlock( _pos ) != type ) {
                            return 0;
                        }
                        if ( _world.Map.GetBlock( _pos.X, _pos.Y, _nextPos ) == Block.Water ) {
                            _world.Map.QueueUpdate( new BlockUpdate( null, _pos, Block.Water ) );
                            _world.Map.QueueUpdate( new BlockUpdate( null, ( short )_pos.X, ( short )_pos.Y, ( short )_nextPos, type ) );
                            _nextPos++;
                            _firstMove = false;
                            return Delay;
                        }
                    }
                    if ( _world.Map.GetBlock( _pos.X, _pos.Y, _nextPos - 1 ) != type ) {
                        return 0;
                    }
                    if ( _world.Map.GetBlock( _pos.X, _pos.Y, _nextPos ) == Block.Water ) {
                        _world.Map.QueueUpdate( new BlockUpdate( null, ( short )_pos.X, ( short )_pos.Y, ( short )( _nextPos - 1 ), Block.Water ) );
                        _world.Map.QueueUpdate( new BlockUpdate( null, ( short )_pos.X, ( short )_pos.Y, ( short )_nextPos, type ) );
                        _nextPos++;
                    }
                }
                return Delay;
            }
        }