Whenever I run my game from my IntelIJ IDEA the game runs fine. It finds every folder and every asset in there. But whenever I build my game with :desktop:dist
and run it it will not see the folder I try to open as a folder and it will have 0 contents.
This is the code I use to open the folder:
FileHandle mapFolder = Gdx.files.internal("maps");
System.out.println(mapFolder.list().length);
for (FileHandle entry : mapFolder.list()) {
System.out.println("something is in");
maps.add(new Map(entry.toString()));
}
loadMap(maps.get(0));
The length it prints is 0. It does not print something is in
so im fairly sure this is not working.
Whenever I try Gdx.files.classpath
I get this error: Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Cannot list a classpath directory: maps
For clarification: It's a desktop only project. So no android.
I cannot figure it out, and I've looked at a lot of topics to try and fix this issue.