mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 17:57:38 +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) {
|
protected void createDefaultConfiguration(String name) {
|
||||||
File actual = new File(getDataFolder(), name);
|
File actual = new File(getDataFolder(), name);
|
||||||
if (!actual.exists()) {
|
if (!actual.exists()) {
|
||||||
try (JarFile file = new JarFile(getFile())) {
|
try {
|
||||||
ZipEntry copy = file.getEntry("defaults/" + name);
|
InputStream stream = getResource("defaults/" + name);
|
||||||
if (copy == null) throw new FileNotFoundException();
|
if (stream == null) throw new FileNotFoundException();
|
||||||
copyDefaultConfig(file.getInputStream(copy), actual, name);
|
copyDefaultConfig(stream, actual, name);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
getLogger().severe("Unable to read default configuration: " + name);
|
getLogger().severe("Unable to read default configuration: " + name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user