use of org.terasology.module.PathModule in project Terasology by MovingBlocks.
the class AbstractEditorScreen method getPath.
protected Path getPath(AssetDataFile source) {
List<String> path = source.getPath();
Name moduleName = new Name(path.get(0));
if (moduleManager.getEnvironment().get(moduleName) instanceof PathModule) {
path.add(source.getFilename());
String[] pathArray = path.toArray(new String[path.size()]);
// Copy all the elements after the first to a separate array for getPath().
String first = pathArray[0];
String[] more = Arrays.copyOfRange(pathArray, 1, pathArray.length);
return moduleManager.getEnvironment().getFileSystem().getPath(first, more);
}
return null;
}
Aggregations