File tree Expand file tree Collapse file tree
src/main/java/org/mvplugins/multiverse/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -623,6 +623,14 @@ public String getBukkitYmlPath() {
623623 return configHandle .get (configNodes .bukkitYmlPath );
624624 }
625625
626+ public Try <Void > setServerPropertiesPath (String serverPropertiesPath ) {
627+ return configHandle .set (configNodes .serverPropertiesPath , serverPropertiesPath );
628+ }
629+
630+ public String getServerPropertiesPath () {
631+ return configHandle .get (configNodes .serverPropertiesPath );
632+ }
633+
626634 /**
627635 * {@inheritDoc}
628636 */
Original file line number Diff line number Diff line change @@ -512,6 +512,13 @@ private <N extends Node> N node(N node) {
512512 .name ("bukkit-yml-path" )
513513 .build ());
514514
515+ final ConfigNode <String > serverPropertiesPath = node (ConfigNode .builder ("misc.server-properties-path" , String .class )
516+ .comment ("Change this if you use a custom path for the server.properties file with `--config` startup flag." )
517+ .comment ("Note: this config option needs a server restart to take effect." )
518+ .defaultValue ("server.properties" )
519+ .name ("server-properties-path" )
520+ .build ());
521+
515522 final ConfigNode <Integer > globalDebug = node (ConfigNode .builder ("misc.global-debug" , Integer .class )
516523 .comment ("" )
517524 .comment ("This is our debug flag to help identify issues with Multiverse." )
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public File getServerFolder() {
7777 */
7878 public @ Nullable File getServerProperties () {
7979 if (this .serverProperties == null ) {
80- this .serverProperties = findFileFromServerDirectory ("server.properties" );
80+ this .serverProperties = findFileFromServerDirectory (config . getServerPropertiesPath () );
8181 Logging .finer ("server.properties: %s" , this .serverProperties );
8282 }
8383 return this .serverProperties ;
You can’t perform that action at this time.
0 commit comments