mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 05:26:29 +01:00
Don't remove world config when world is saved
This commit is contained in:
parent
64650ca9d5
commit
612fb6828e
@ -59,7 +59,7 @@ public class DResourceWorld implements ResourceWorld {
|
||||
folder.mkdir();
|
||||
}
|
||||
|
||||
File configFile = new File(folder, "config.yml");
|
||||
File configFile = new File(folder, WorldConfig.FILE_NAME);
|
||||
if (configFile.exists()) {
|
||||
config = new WorldConfig(plugin, configFile);
|
||||
}
|
||||
@ -72,7 +72,7 @@ public class DResourceWorld implements ResourceWorld {
|
||||
|
||||
this.folder = folder;
|
||||
|
||||
File configFile = new File(folder, "config.yml");
|
||||
File configFile = new File(folder, WorldConfig.FILE_NAME);
|
||||
if (configFile.exists()) {
|
||||
config = new WorldConfig(plugin, configFile);
|
||||
}
|
||||
@ -110,7 +110,7 @@ public class DResourceWorld implements ResourceWorld {
|
||||
*/
|
||||
public WorldConfig getConfig(boolean generate) {
|
||||
if (config == null) {
|
||||
File file = new File(folder, "config.yml");
|
||||
File file = new File(folder, WorldConfig.FILE_NAME);
|
||||
if (file.exists()) {
|
||||
try {
|
||||
file.createNewFile();
|
||||
@ -299,7 +299,7 @@ public class DResourceWorld implements ResourceWorld {
|
||||
|
||||
void clearFolder() {
|
||||
for (File file : FileUtil.getFilesForFolder(getFolder())) {
|
||||
if (file.getName().equals(SignData.FILE_NAME)) {
|
||||
if (file.getName().equals(SignData.FILE_NAME) || file.getName().equals(WorldConfig.FILE_NAME)) {
|
||||
continue;
|
||||
}
|
||||
if (file.isDirectory()) {
|
||||
|
@ -38,6 +38,8 @@ public class WorldConfig extends GameRuleContainer {
|
||||
|
||||
private DungeonsXL plugin;
|
||||
|
||||
public static final String FILE_NAME = "config.yml";
|
||||
|
||||
private File file;
|
||||
private ConfigurationSection config;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user