}
}
public void split() throws IOException {
List<ObjectPath> pathTable = asset.getPaths();
TypeTree typeTree = asset.getTypeTree();
// assets with just one object can't be split any further
if (pathTable.size() == 1) {
L.warning("Asset doesn't contain sub-assets!");
return;
}
for (ObjectPath path : pathTable) {
// skip filtered classes
if (cf != null && !cf.accept(path)) {
continue;
}
String className = ClassID.getNameForID(path.getClassID(), true);
AssetFile subAsset = new AssetFile();
subAsset.getHeader().setFormat(asset.getHeader().getFormat());
ObjectPath subFieldPath = new ObjectPath();
subFieldPath.setClassID1(path.getClassID1());
subFieldPath.setClassID2(path.getClassID2());
subFieldPath.setLength(path.getLength());
subFieldPath.setOffset(0);
subFieldPath.setPathID(1);
subAsset.getPaths().add(subFieldPath);
TypeTree subTypeTree = subAsset.getTypeTree();
subTypeTree.setEngineVersion(typeTree.getEngineVersion());
subTypeTree.setVersion(-2);
subTypeTree.setFormat(typeTree.getFormat());
subTypeTree.getFields().put(path.getClassID(), typeTree.getFields().get(path.getClassID()));
subAsset.setDataBuffer(asset.getPathBuffer(path));
Path subAssetDir = outputDir.resolve(className);
if (Files.notExists(subAssetDir)) {