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

Properly generate the default configuration

Dieser Commit ist enthalten in:
Wyatt Childers 2016-05-18 19:35:24 -04:00
Ursprung 27b6efefdb
Commit 1c2348cd41
2 geänderte Dateien mit 10 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -36,7 +36,7 @@ import java.util.logging.Logger;
public class ConfigurateConfiguration extends LocalConfiguration {
private final ConfigurationLoader<CommentedConfigurationNode> config;
protected final ConfigurationLoader<CommentedConfigurationNode> config;
protected final Logger logger;
protected CommentedConfigurationNode node;
@ -50,7 +50,7 @@ public class ConfigurateConfiguration extends LocalConfiguration {
public void load() {
try {
ConfigurationOptions options = ConfigurationOptions.defaults();
options.setShouldCopyDefaults(true);
options = options.setShouldCopyDefaults(true);
node = config.load(options);
} catch (IOException e) {

Datei anzeigen

@ -24,6 +24,8 @@ import ninja.leaping.configurate.commented.CommentedConfigurationNode;
import ninja.leaping.configurate.loader.ConfigurationLoader;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SpongeConfiguration extends ConfigurateConfiguration {
@ -41,6 +43,12 @@ public class SpongeConfiguration extends ConfigurateConfiguration {
creativeEnable = node.getNode("use-in-creative").getBoolean(false);
cheatMode = node.getNode("cheat-mode").getBoolean(false);
try {
config.save(node);
} catch (IOException e) {
logger.log(Level.WARNING, "Error loading WorldEdit configuration", e);
}
}
@Override