use of org.terasology.engine.rendering.assets.texture.TextureRegionAsset in project Terasology by MovingBlocks.
the class IconMeshDataProducer method getAssetData.
@Override
public Optional<MeshData> getAssetData(ResourceUrn urn) throws IOException {
if (ICON_DISCRIMINATOR.equals(urn.getResourceName())) {
ResourceUrn textureUrn = new ResourceUrn(urn.getModuleName().toString() + ResourceUrn.RESOURCE_SEPARATOR + urn.getFragmentName().toString());
Optional<TextureRegionAsset> textureRegionAsset = assetManager.getAsset(textureUrn, TextureRegionAsset.class);
if (textureRegionAsset.isPresent() && !textureRegionAsset.get().getTexture().isDisposed()) {
return Optional.of(IconMeshFactory.generateIconMeshData(textureRegionAsset.get()));
}
}
return Optional.empty();
}
Aggregations