|
@@ -35,6 +35,7 @@ public class Config extends BaseCollection {
|
|
|
|
|
|
@Getter(AccessLevel.PACKAGE)
|
|
@Getter(AccessLevel.PACKAGE)
|
|
private final ConfigSource source;
|
|
private final ConfigSource source;
|
|
|
|
+ private boolean loaded = false;
|
|
@Environment(EnvType.CLIENT)
|
|
@Environment(EnvType.CLIENT)
|
|
private TranslationKey translation;
|
|
private TranslationKey translation;
|
|
|
|
|
|
@@ -92,6 +93,9 @@ public class Config extends BaseCollection {
|
|
* @return this config
|
|
* @return this config
|
|
*/
|
|
*/
|
|
public Config add(ConfigContainer... containers) {
|
|
public Config add(ConfigContainer... containers) {
|
|
|
|
+ if (loaded) {
|
|
|
|
+ throw new IllegalStateException("Cannot add container(s) after config was loaded already");
|
|
|
|
+ }
|
|
resolve(containers);
|
|
resolve(containers);
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
@@ -105,6 +109,7 @@ public class Config extends BaseCollection {
|
|
if(!isEmpty()) {
|
|
if(!isEmpty()) {
|
|
source.load(this);
|
|
source.load(this);
|
|
}
|
|
}
|
|
|
|
+ loaded = true;
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|