use of org.spongepowered.api.asset.AssetId in project LanternServer by LanternPowered.
the class PluginAssetProvider method get.
@Override
public Asset get() {
final AssetId assetId = this.point.getAnnotation(AssetId.class);
String name;
if (assetId != null) {
name = assetId.value();
} else {
name = provideName(this.point).orElseThrow(() -> new IllegalStateException("Missing @AssetId or @Named annotation."));
}
if (name.indexOf(':') == -1) {
name = this.container.getId() + ':' + name;
}
final String name1 = name;
return this.assetManager.getAsset(name).orElseThrow(() -> new NoSuchElementException("Cannot find asset " + name1));
}
Aggregations