Esempio n. 1
0
EntityInfo const &EntityIdentifier::getEntityInfo(QString id) const {
  for (auto it = packs.constBegin(); it != packs.constEnd(); ++it) {
    if (it->enabled) {
      TentityMap::const_iterator info = it->map.find(id);
      if (info != it->map.end()) {  // found it
        return info.value();
      }
    }
  }
  return entityDummy;
}
Esempio n. 2
0
EntityInfo const &EntityIdentifier::getEntityInfo(const QString id) const {
  for (auto it = packs.constBegin(); it != packs.constEnd(); ++it) {
    if (it->enabled) {
      // convert ID to lower case and strip "minecraft:" if exists
      TentityMap::const_iterator info = it->map.find(id.toLower().remove("minecraft:"));
      if (info != it->map.end()) {  // found it
        return info.value();
      }
    }
  }
  return entityDummy;
}