Implement Auto Config Screen registration (Forge/ModMenu)
This commit is contained in:
@@ -39,4 +39,7 @@ public class ConfigController implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public static HashMap<Object, FileWatcher> getMonitoredConfigs() {
|
||||
return monitoredConfigs;
|
||||
}
|
||||
}
|
||||
|
@@ -18,6 +18,8 @@ public class ModuleConfig {
|
||||
|
||||
private final transient String configName;
|
||||
|
||||
private final transient String modId;
|
||||
|
||||
/**
|
||||
* Set up the config
|
||||
*
|
||||
@@ -36,6 +38,7 @@ public class ModuleConfig {
|
||||
File configDir = new File("config" + (subFolder.isEmpty() ? "" : File.separator + subFolder));
|
||||
configPath = new File(configDir + File.separator + configName + ".toml");
|
||||
networkID = modId + ":conf_" + configName.replace("-", "_");
|
||||
this.modId = modId;
|
||||
this.configName = configName;
|
||||
|
||||
/* Check if the required directories exists, otherwise we create them */
|
||||
@@ -154,4 +157,12 @@ public class ModuleConfig {
|
||||
public String getConfigName() {
|
||||
return configName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the MODID of the Module the config is registered to
|
||||
* @return
|
||||
*/
|
||||
public String getModId() {
|
||||
return modId;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,13 @@
|
||||
package me.hypherionmc.craterlib.common.config.annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
* @date 06/08/2022
|
||||
* Allows Modules to disable Automatic Config Screens
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface NoConfigScreen {
|
||||
}
|
Reference in New Issue
Block a user