mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Properly generate the default configuration
This commit is contained in:
parent
27b6efefdb
commit
1c2348cd41
@ -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) {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user