public Block obtainBlock(String prototypeName,@Nullable String uuid){
  Block block;
  if (uuid != null) {
    WeakReference<Block> ref=mBlockRefs.get(uuid);
    if (ref != null) {
      block=ref.get();
      if (block != null) {
        throw new IllegalArgumentException("Block with given UUID \"" + uuid + "\" already exists. Duplicate UUIDs not allowed.");
      }
    }
  }
  if (!mBlockTemplates.containsKey(prototypeName)) {
    Log.w(TAG,"Block " + prototypeName + " not found.");
    return null;
  }
  Block.Builder builder=new Block.Builder(mBlockTemplates.get(prototypeName));
  if (uuid != null) {
    builder.setUuid(uuid);
  }
  block=builder.build();
  mBlockRefs.put(block.getId(),new WeakReference<Block>(block));
  return block;
}

public Block obtainBlock ( String prototypeName , @ Nullable String uuid ) { Block block ; if ( uuid != null ) { WeakReference < Block > ref = mBlockRefs . get ( uuid ) ; if ( ref != null ) { block = ref . get ( ) ; if ( block != null ) { throw new IllegalArgumentException ( "Block with given UUID \"" + uuid + "\" already exists. Duplicate UUIDs not allowed." ) ; } } } if ( ! mBlockTemplates . containsKey ( prototypeName ) ) { Log . w ( TAG , "Block " + prototypeName + " not found." ) ; return null ; } Block . Builder builder = new Block . Builder ( mBlockTemplates . get ( prototypeName ) ) ; if ( uuid != null ) { builder . setUuid ( uuid ) ; } block = builder . build ( ) ; mBlockRefs . put ( block . getId ( ) , new WeakReference < Block > ( block ) ) ; return block ; }
creates a block of the specified type using one of the master blocks known to this factory . if the prototypename is not one of the known block types null will be returned instead .
