[BUG] Use Sync config loading, so config doesn't parse before it's loaded
This commit is contained in:
@@ -10,7 +10,7 @@ import java.io.File;
|
||||
* Base Config class containing the save, upgrading and loading logic.
|
||||
* All config classes must extend this class
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(forRemoval = true, since = "2.1.0")
|
||||
public class ModuleConfig extends AbstractConfig {
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,7 @@ public class JsonConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).build();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -26,7 +26,7 @@ public class TomlConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).build();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -2,7 +2,7 @@
|
||||
version_major=2
|
||||
version_minor=1
|
||||
version_patch=0
|
||||
version_build=0
|
||||
version_build=1
|
||||
|
||||
#Mod
|
||||
mod_author=HypherionSA
|
||||
|
@@ -10,7 +10,7 @@ import java.io.File;
|
||||
* Base Config class containing the save, upgrading and loading logic.
|
||||
* All config classes must extend this class
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(forRemoval = true, since = "2.1.0")
|
||||
public class ModuleConfig extends AbstractConfig {
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,7 @@ public class JsonConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).build();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -26,7 +26,7 @@ public class TomlConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).build();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -2,7 +2,7 @@
|
||||
version_major=2
|
||||
version_minor=1
|
||||
version_patch=0
|
||||
version_build=0
|
||||
version_build=1
|
||||
|
||||
#Mod
|
||||
mod_author=HypherionSA
|
||||
|
@@ -10,7 +10,7 @@ import java.io.File;
|
||||
* Base Config class containing the save, upgrading and loading logic.
|
||||
* All config classes must extend this class
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(forRemoval = true, since = "2.1.0")
|
||||
public class ModuleConfig extends AbstractConfig {
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,7 @@ public class JsonConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).build();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -26,7 +26,7 @@ public class TomlConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).build();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -2,7 +2,7 @@
|
||||
version_major=2
|
||||
version_minor=1
|
||||
version_patch=0
|
||||
version_build=0
|
||||
version_build=1
|
||||
|
||||
#Mod
|
||||
mod_author=HypherionSA
|
||||
|
@@ -10,7 +10,7 @@ import java.io.File;
|
||||
* Base Config class containing the save, upgrading and loading logic.
|
||||
* All config classes must extend this class
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(forRemoval = true, since = "2.1.0")
|
||||
public class ModuleConfig extends AbstractConfig {
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,7 @@ public class JsonConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).build();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -26,7 +26,7 @@ public class TomlConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).build();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -2,7 +2,7 @@
|
||||
version_major=2
|
||||
version_minor=1
|
||||
version_patch=0
|
||||
version_build=0
|
||||
version_build=1
|
||||
|
||||
#Mod
|
||||
mod_author=HypherionSA
|
||||
|
@@ -10,7 +10,7 @@ import java.io.File;
|
||||
* Base Config class containing the save, upgrading and loading logic.
|
||||
* All config classes must extend this class
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(forRemoval = true, since = "2.1.0")
|
||||
public class ModuleConfig extends AbstractConfig {
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,7 @@ public class JsonConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).build();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -26,7 +26,7 @@ public class TomlConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).build();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -2,7 +2,7 @@
|
||||
version_major=2
|
||||
version_minor=1
|
||||
version_patch=0
|
||||
version_build=0
|
||||
version_build=1
|
||||
|
||||
#Mod
|
||||
mod_author=HypherionSA
|
||||
|
@@ -10,7 +10,7 @@ import java.io.File;
|
||||
* Base Config class containing the save, upgrading and loading logic.
|
||||
* All config classes must extend this class
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(forRemoval = true, since = "2.1.0")
|
||||
public class ModuleConfig extends AbstractConfig {
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,7 @@ public class JsonConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).build();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -26,7 +26,7 @@ public class TomlConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).build();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -2,7 +2,7 @@
|
||||
version_major=2
|
||||
version_minor=1
|
||||
version_patch=0
|
||||
version_build=0
|
||||
version_build=1
|
||||
|
||||
#Mod
|
||||
mod_author=HypherionSA
|
||||
|
@@ -10,7 +10,7 @@ import java.io.File;
|
||||
* Base Config class containing the save, upgrading and loading logic.
|
||||
* All config classes must extend this class
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(forRemoval = true, since = "2.1.0")
|
||||
public class ModuleConfig extends AbstractConfig {
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,7 @@ public class JsonConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).build();
|
||||
FileConfig config = FileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -26,7 +26,7 @@ public class TomlConfigFormat<S> extends AbstractConfigFormat<S> {
|
||||
public S readConfig(S conf) {
|
||||
/* Set up the Serializer and Config Object */
|
||||
ObjectConverter converter = new ObjectConverter();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).build();
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(getConfigPath()).sync().build();
|
||||
config.load();
|
||||
|
||||
/* Load the config and return the loaded config */
|
||||
|
@@ -127,4 +127,4 @@ publisher {
|
||||
curseDepends {
|
||||
required("fabric-api")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -112,4 +112,4 @@ publisher {
|
||||
setArtifact(remapJar)
|
||||
setCurseEnvironment("both")
|
||||
setIsManualRelease(true)
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
version_major=2
|
||||
version_minor=1
|
||||
version_patch=0
|
||||
version_build=0
|
||||
version_build=1
|
||||
|
||||
#Mod
|
||||
mod_author=HypherionSA
|
||||
|
@@ -14,4 +14,4 @@ pluginManagement {
|
||||
}
|
||||
|
||||
rootProject.name = 'CraterLib'
|
||||
include("Common", "Fabric", "NeoForge")
|
||||
include("Common", "Fabric", "NeoForge")
|
||||
|
@@ -1 +1 @@
|
||||
fcc1c816e78367336b276a7665db255d84a70e0b
|
||||
c808f5384154268c09c915515116124d8e6e1a5d
|
Reference in New Issue
Block a user