use of com.archyx.aureliumskills.source.SourceTag in project AureliumSkills by Archy-X.
the class LootParser method parseSources.
@NotNull
protected Set<Source> parseSources(Map<?, ?> map) {
if (map.containsKey("sources")) {
Set<Source> sources = new HashSet<>();
for (String entry : getStringList(map, "sources")) {
// Try get source name
Source source = plugin.getSourceRegistry().valueOf(entry);
if (source != null) {
sources.add(source);
} else {
// Try to get tag if not found
SourceTag tag = SourceTag.valueOf(entry.toUpperCase(Locale.ROOT));
// All all sources in tag
sources.addAll(plugin.getSourceManager().getTag(tag));
}
}
return sources;
} else {
return new HashSet<>();
}
}