Hey again!
I actually progressed very well since yetersday and found a way to do it properly, but I still need to solve an issue.
Firstly, here's my new method:
public final class CopyFiles
{
public static void toWorld(String dir, String file, int dim) throws IOException
{
Path FROM = new File(new ResourceLocation(Reference.MODID + ":worlds/" + dir + "/" + file).getPath()).toPath();
Path TO = new File(DimensionManager.getCurrentSaveRootDirectory(), "DIM-64/" + file).toPath();
CopyOption[] options = new CopyOption[]
{
StandardCopyOption.COPY_ATTRIBUTES
};
Files.copy(FROM, TO, options);
}
}
But upon loading the world, the game crashes and reports: java.nio.file.NoSuchFileException: worlds\wol\region\r.0.0.mca which I interpretate as an error with the FROM variable. Anything helping would be very cool, thanks in advance.
EDIT: Woops, didn't saw the thread had a second page, currently looking at what you said, this very comment is useless, do like if you didn't saw it.