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

Merge pull request #359 from tsao-chi-fork/patch-1

use JavaPlugin.getResource() instead of JarFile.getEntry()
Dieser Commit ist enthalten in:
Matt 2020-03-21 17:32:14 -04:00 committet von GitHub
Commit 8f2c3df61b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -91,9 +91,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.jar.JarFile;
import java.util.logging.Level;
import java.util.zip.ZipEntry;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.sk89q.worldedit.internal.anvil.ChunkDeleter.DELCHUNKS_FILE_NAME;
@ -440,10 +438,9 @@ 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);
}