protected override int PerformInternal()
{
lock ( _world.SyncRoot ) {
if ( _world.sandPhysics ) {
Block nblock = _world.Map.GetBlock( _pos.X, _pos.Y, _nextPos );
if ( _firstMove ) {
if ( _world.Map.GetBlock( _pos ) != _type ) {
return 0;
}
if ( _world.Map.GetBlock( _pos.X, _pos.Y, _nextPos ) == Block.Air ) {
_world.Map.QueueUpdate( new BlockUpdate( null, _pos, Block.Air ) );
_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 ) != Block.Air ) {
return 0;
}
if ( Physics.BlockThrough( nblock ) ) {
_world.Map.QueueUpdate( new BlockUpdate( null, ( short )_pos.X, ( short )_pos.Y, ( short )( _nextPos + 1 ), Block.Air ) );
_world.Map.QueueUpdate( new BlockUpdate( null, ( short )_pos.X, ( short )_pos.Y, ( short )_nextPos, _type ) );
_nextPos--;
}
}
return Delay;
}
}