mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
use JavaPlugin.getResource() instead of JarFile.getEntry()
This commit is contained in:
parent
c1fe16b0e9
commit
fbb1078569
@ -440,10 +440,10 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
|
||||
protected void createDefaultConfiguration(String name) {
|
||||
File actual = new File(getDataFolder(), name);
|
||||
if (!actual.exists()) {
|
||||
try (JarFile file = new JarFile(getFile())) {
|
||||
ZipEntry copy = file.getEntry("defaults/" + name);
|
||||
if (copy == null) throw new FileNotFoundException();
|
||||
copyDefaultConfig(file.getInputStream(copy), actual, name);
|
||||
try {
|
||||
InputStream stream = getResource("defaults/" + name);
|
||||
if (stream == null) throw new FileNotFoundException();
|
||||
copyDefaultConfig(stream, actual, name);
|
||||
} catch (IOException e) {
|
||||
getLogger().severe("Unable to read default configuration: " + name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user