diff --git a/src/main/java/world/bentobox/bentobox/api/configuration/ConfigEntry.java b/src/main/java/world/bentobox/bentobox/api/configuration/ConfigEntry.java index efa40259d..cd334b0c0 100644 --- a/src/main/java/world/bentobox/bentobox/api/configuration/ConfigEntry.java +++ b/src/main/java/world/bentobox/bentobox/api/configuration/ConfigEntry.java @@ -30,4 +30,11 @@ public @interface ConfigEntry { * @since 1.5.3 */ String video() default ""; + + /** + * Sets whether this config entry requires restarting the server in order to take changes into account. + * @return {@code true} if this config entry requires restarting the server in order to take changes into account, {@code false} otherwise. + * @since 1.12.0 + */ + boolean needsRestart() default false; } \ No newline at end of file diff --git a/src/main/java/world/bentobox/bentobox/database/yaml/YamlDatabaseHandler.java b/src/main/java/world/bentobox/bentobox/database/yaml/YamlDatabaseHandler.java index 80beba26c..ed341341c 100644 --- a/src/main/java/world/bentobox/bentobox/database/yaml/YamlDatabaseHandler.java +++ b/src/main/java/world/bentobox/bentobox/database/yaml/YamlDatabaseHandler.java @@ -518,6 +518,10 @@ public class YamlDatabaseHandler extends AbstractDatabaseHandler { if (configEntry.needsReset()) { setComment("/!\\ BentoBox currently does not support changing this value mid-game. If you do need to change it, do a full reset of your databases and worlds.", config, yamlComments, parent); } + // Tell if the configEntry needs the server to be restarted. + if (configEntry.needsRestart()) { + setComment("/!\\ In order to apply the changes made to this option, you must restart your server. Reloading BentoBox or the server won't work.", config, yamlComments, parent); + } } private void setComment(@NonNull String comment, @NonNull YamlConfiguration config, @NonNull Map yamlComments, @NonNull String parent) {