mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +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();
|
folder.mkdir();
|
||||||
}
|
}
|
||||||
|
|
||||||
File configFile = new File(folder, "config.yml");
|
File configFile = new File(folder, WorldConfig.FILE_NAME);
|
||||||
if (configFile.exists()) {
|
if (configFile.exists()) {
|
||||||
config = new WorldConfig(plugin, configFile);
|
config = new WorldConfig(plugin, configFile);
|
||||||
}
|
}
|
||||||
@ -72,7 +72,7 @@ public class DResourceWorld implements ResourceWorld {
|
|||||||
|
|
||||||
this.folder = folder;
|
this.folder = folder;
|
||||||
|
|
||||||
File configFile = new File(folder, "config.yml");
|
File configFile = new File(folder, WorldConfig.FILE_NAME);
|
||||||
if (configFile.exists()) {
|
if (configFile.exists()) {
|
||||||
config = new WorldConfig(plugin, configFile);
|
config = new WorldConfig(plugin, configFile);
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ public class DResourceWorld implements ResourceWorld {
|
|||||||
*/
|
*/
|
||||||
public WorldConfig getConfig(boolean generate) {
|
public WorldConfig getConfig(boolean generate) {
|
||||||
if (config == null) {
|
if (config == null) {
|
||||||
File file = new File(folder, "config.yml");
|
File file = new File(folder, WorldConfig.FILE_NAME);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
try {
|
try {
|
||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
@ -299,7 +299,7 @@ public class DResourceWorld implements ResourceWorld {
|
|||||||
|
|
||||||
void clearFolder() {
|
void clearFolder() {
|
||||||
for (File file : FileUtil.getFilesForFolder(getFolder())) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
|
@ -38,6 +38,8 @@ public class WorldConfig extends GameRuleContainer {
|
|||||||
|
|
||||||
private DungeonsXL plugin;
|
private DungeonsXL plugin;
|
||||||
|
|
||||||
|
public static final String FILE_NAME = "config.yml";
|
||||||
|
|
||||||
private File file;
|
private File file;
|
||||||
private ConfigurationSection config;
|
private ConfigurationSection config;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user