Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-08 04:20:06 +01:00
use JavaPlugin.getResource() instead of JarFile.getEntry()
Dieser Commit ist enthalten in:
Ursprung
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);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren