Skip to content

Commit

Permalink
Merge pull request #361 from Multiverse/config_tweak
Browse files Browse the repository at this point in the history
Config Tweak
  • Loading branch information
dumptruckman authored Jan 10, 2022
2 parents 9d217df + a7e2743 commit 340eac8
Show file tree
Hide file tree
Showing 8 changed files with 259 additions and 253 deletions.
15 changes: 0 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ and adjust the build number accordingly -->
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.feildmaster.lib.configuration</pattern>
<shadedPattern>com.onarandombox.multiverseinventories.util</shadedPattern>
</relocation>
<relocation>
<pattern>com.dumptruckman.minecraft.util.Logging</pattern>
<shadedPattern>com.onarandombox.multiverseinventories.utils.InvLogging
Expand Down Expand Up @@ -229,17 +225,6 @@ and adjust the build number accordingly -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.feildmaster.lib</groupId>
<artifactId>EnhancedConfiguration</artifactId>
<version>1.1.3</version>
<exclusions>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.onarandombox.multiverseadventure</groupId>
<artifactId>Multiverse-Adventure</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ public void createDefaultGroup() {
worlds.append(", ").append(defaultEnd.getName());
}
updateGroup(worldGroup);
plugin.getMVIConfig().setFirstRun(false);
plugin.getMVIConfig().save();
Logging.info("Created a default group for you containing all of your default worlds: " + worlds.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ public final class InventoriesConfig {
* Enum for easily keeping track of config paths, defaults and comments.
*/
public enum Path {
/**
* Add a comment to the top of file.
*/
SETTINGS("settings", null, "# ===[ Multiverse Inventories Config ]==="),
/**
* Locale name config path, default and comments.
*/
Expand Down Expand Up @@ -62,7 +58,7 @@ public enum Path {
*/
OPTIONAL_SHARES("shares.use_optionals", new ArrayList<String>(),
"# You must specify optional shares you wish to use here or they will be ignored.",
"# The only built in optional share is \"economy\""),
"# The only built in optional shares are \"economy\" and \"last_location\"."),
/**
* Whether or not to split data based on game modes.
*/
Expand Down Expand Up @@ -127,12 +123,11 @@ private List<String> getComments() {

// Load the configuration file into memory
config = new CommentedYamlConfiguration(configFile, true);
config.load();

// Sets defaults config values
this.setDefaults();

config.getConfig().options().header("# Multiverse-Inventories Settings");
config.getConfig().options().header("Multiverse-Inventories Settings");

// Saves the configuration from memory to file
config.save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ public void run() {
if (getGroupManager().getGroups().isEmpty()) {
getGroupManager().createDefaultGroup();
}

getMVIConfig().setFirstRun(false);
}
getGroupManager().checkForConflicts(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ final class YamlWorldGroupManager extends AbstractWorldGroupManager {
}
// Load the configuration file into memory
groupsConfig = new CommentedYamlConfiguration(groupConfigFile, true);
groupsConfig.load();

if (migrateGroups) {
migrateGroups(config);
Expand All @@ -54,7 +53,7 @@ final class YamlWorldGroupManager extends AbstractWorldGroupManager {
this.getConfig().createSection("groups");
}

groupsConfig.getConfig().options().header("# Multiverse-Inventories Groups");
groupsConfig.getConfig().options().header("Multiverse-Inventories Groups");
// Saves the configuration from memory to file
groupsConfig.save();

Expand Down
Loading

0 comments on commit 340eac8

Please sign in to comment.