fCraft.FireworkParticle.PerformInternal C# (CSharp) Method

PerformInternal() protected method

protected PerformInternal ( ) : int
return int
        protected override int PerformInternal()
        {
            Random _rand = new Random();
            if ( _first ) {
                if ( _world.Map.GetBlock( _startingPos.X, _startingPos.Y, _nextZ ) != Block.Air ||
                    Count > _maxFall ) {
                    return 0;
                }
                _world.Map.QueueUpdate( new BlockUpdate( null, ( short )_startingPos.X, ( short )_startingPos.Y, ( short )_nextZ, _block ) );
                _first = false;
                return _rand.Next( 100, 401 );
            }
            _world.Map.QueueUpdate( new BlockUpdate( null, ( short )_startingPos.X, ( short )_startingPos.Y, ( short )_nextZ, Block.Air ) );
            Count++;
            _nextZ--;
            if ( _world.Map.GetBlock( _startingPos.X, _startingPos.Y, _nextZ ) != Block.Air ||
                Count > _maxFall ) {
                return 0;
            }
            _world.Map.QueueUpdate( new BlockUpdate( null, ( short )_startingPos.X, ( short )_startingPos.Y, ( short )_nextZ, _block ) );
            return _rand.Next( 100, 401 );
        }