Class BundleConfigSpec
java.lang.Object
de.luckymcdev.foundryengine.common.bundle.config.BundleConfigSpec
Builder used inside
BundleEntrypoint.onLoad()
to declare typed config entries for a bundle.
Example usage in a Groovy entrypoint:
class MyEntrypoint extends BundleEntrypoint {
ConfigValue<Boolean> enableFeature
ConfigValue<Integer> maxCount
void onLoad() {
def spec = new BundleConfigSpec(bundleConfig)
enableFeature = spec.defineBoolean("enable_feature", true, "Whether the feature is enabled")
maxCount = spec.defineInt("max_count", 10, "Maximum number of things")
spec.build()
if (enableFeature.get()) { ... }
}
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild()Finalizes the spec and triggers a load from disk.defineBoolean(String key, boolean defaultValue) defineBoolean(String key, boolean defaultValue, String comment) Defines a boolean config value.defineDouble(String key, double defaultValue) defineDouble(String key, double defaultValue, String comment) Defines a double config value.Defines an integer config value.defineString(String key, String defaultValue) defineString(String key, String defaultValue, String comment) Defines a string config value.
-
Constructor Details
-
BundleConfigSpec
-
-
Method Details
-
defineBoolean
Defines a boolean config value. -
defineBoolean
-
defineInt
Defines an integer config value. -
defineInt
-
defineDouble
Defines a double config value. -
defineDouble
-
defineString
Defines a string config value. -
defineString
-
build
public void build()Finalizes the spec and triggers a load from disk. Must be called after all values are defined.
-