public void register(ItemType type){
  int id;
  if (type instanceof BlockType) {
    id=nextBlockId;
  }
 else {
    id=nextItemId;
  }
  while (idToType.containsKey(id)) {
    ++id;
  }
  idToType.put(id,type);
  type.setId(id);
  if (type instanceof BlockType) {
    nextBlockId=id + 1;
  }
 else {
    nextItemId=id + 1;
  }
}

public void register ( ItemType type ) { int id ; if ( type instanceof BlockType ) { id = nextBlockId ; } else { id = nextItemId ; } while ( idToType . containsKey ( id ) ) { ++ id ; } idToType . put ( id , type ) ; type . setId ( id ) ; if ( type instanceof BlockType ) { nextBlockId = id + 1 ; } else { nextItemId = id + 1 ; } }
register a new , non - vanilla itemtype . it will be assigned an id automatically .
