use of org.terasology.i18n.assets.Translation in project Terasology by MovingBlocks.
the class TranslationSystemImpl method refresh.
@Override
public void refresh() {
Set<ResourceUrn> urns = assetManager.getAvailableAssets(Translation.class);
for (ResourceUrn urn : urns) {
Optional<Translation> asset = assetManager.getAsset(urn, Translation.class);
if (asset.isPresent()) {
Translation trans = asset.get();
Uri uri = trans.getProjectUri();
if (uri.isValid()) {
TranslationProject proj = projects.computeIfAbsent(uri, e -> new StandardTranslationProject());
proj.add(trans);
trans.subscribe(this::onAssetChanged);
logger.info("Discovered " + trans);
} else {
logger.warn("Ignoring invalid project uri: {}", uri);
}
}
}
}
Aggregations