Fixed mod structural crash / Fixed input fragment disappearing

This commit is contained in:
Anuken
2019-10-09 17:36:57 -04:00
parent 3a3c5e2304
commit 16eb069717
6 changed files with 16 additions and 9 deletions

View File

@@ -203,11 +203,14 @@ public class Mods implements Loadable{
private void buildFiles(){
for(LoadedMod mod : loaded){
boolean zipFolder = !mod.file.isDirectory() && mod.root.parent() != null;
String parentName = zipFolder ? mod.root.name() : null;
for(FileHandle file : mod.root.list()){
//ignore special folders like bundles or sprites
if(file.isDirectory() && !specialFolders.contains(file.name())){
//TODO calling child/parent on these files will give you gibberish; create wrapper class.
file.walk(f -> tree.addFile(mod.file.isDirectory() ? f.path().substring(1 + mod.file.path().length()) : f.path(), f));
file.walk(f -> tree.addFile(mod.file.isDirectory() ? f.path().substring(1 + mod.file.path().length()) :
zipFolder ? f.path().substring(parentName.length() + 1) : f.path(), f));
}
}