3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 11:00:05 +01:00

use JavaPlugin.getResource() instead of JarFile.getEntry()

Dieser Commit ist enthalten in:
ㄗㄠˋ ㄑㄧˊ 2020-03-09 13:14:16 +08:00 committet von GitHub
Ursprung c1fe16b0e9
Commit fbb1078569
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -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);
}