mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Merge remote-tracking branch 'origin/1.15' into 1.15
This commit is contained in:
commit
89ee1cb21a
@ -91,9 +91,7 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.jar.JarFile;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.zip.ZipEntry;
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static com.sk89q.worldedit.internal.anvil.ChunkDeleter.DELCHUNKS_FILE_NAME;
|
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) {
|
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 (InputStream stream = getResource("defaults/" + name)) {
|
||||||
ZipEntry copy = file.getEntry("defaults/" + name);
|
if (stream == null) throw new FileNotFoundException();
|
||||||
if (copy == null) throw new FileNotFoundException();
|
copyDefaultConfig(stream, actual, name);
|
||||||
copyDefaultConfig(file.getInputStream(copy), 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