mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-07 17:07:36 +01:00
Added ConfigEntry#needsRestart()
It prints a comment in the config telling that the server must be restarted in order to take the changes into account.
This commit is contained in:
parent
f620601caa
commit
5cd2287d3a
@ -30,4 +30,11 @@ public @interface ConfigEntry {
|
|||||||
* @since 1.5.3
|
* @since 1.5.3
|
||||||
*/
|
*/
|
||||||
String video() default "";
|
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;
|
||||||
}
|
}
|
@ -518,6 +518,10 @@ public class YamlDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
if (configEntry.needsReset()) {
|
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);
|
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<String, String> yamlComments, @NonNull String parent) {
|
private void setComment(@NonNull String comment, @NonNull YamlConfiguration config, @NonNull Map<String, String> yamlComments, @NonNull String parent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user