Addon saveResource overwriting was not working

The method saveResource can take a boolean as an argument to indicate
that the resource should be overwritten from the jar. This was not
working and is fixed.
This commit is contained in:
tastybento 2020-03-01 21:55:16 -08:00
parent b4a1398fcb
commit a4362ce859

View File

@ -4,6 +4,7 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.StandardCopyOption;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@ -270,7 +271,7 @@ public abstract class Addon {
// Make any dirs that need to be made
outFile.getParentFile().mkdirs();
if (!outFile.exists() || replace) {
java.nio.file.Files.copy(in, outFile.toPath());
java.nio.file.Files.copy(in, outFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
return outFile;
}