Java Code Examples for net.minecraftforge.fml.config.ModConfig#Type

The following examples show how to use net.minecraftforge.fml.config.ModConfig#Type . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BetterSprintingConfig.java    From Better-Sprinting with Mozilla Public License 2.0 5 votes vote down vote up
public static void register(ModLoadingContext context, ModConfig.Type type, ForgeConfigSpec spec, String suffix){
	String fileName = BetterSprintingMod.id + "-" + suffix + ".toml";
	context.registerConfig(type, spec, fileName);
	
	if (Files.notExists(Paths.get("config", fileName))){
		migrationFile = Paths.get("config", "bettersprinting.cfg").toAbsolutePath();
		isNew = true; // since keybinds are not migrated and first time setup only modifies keybinds, this is fine
	}
}
 
Example 2
Source File: ModLoadingContext.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void registerConfig(ModConfig.Type type, ForgeConfigSpec spec) {
	getActiveContainer().addConfig(new ModConfig(type, spec, getActiveContainer()));
}
 
Example 3
Source File: ModLoadingContext.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void registerConfig(ModConfig.Type type, ForgeConfigSpec spec, String fileName) {
	getActiveContainer().addConfig(new ModConfig(type, spec, getActiveContainer(), fileName));
}
 
Example 4
Source File: ModContainer.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public ModContainer(String modId) {
	this.modId = modId;
	// TODO: Currently not reading namespace from configuration..
	this.namespace = modId;
	this.configs = new EnumMap<>(ModConfig.Type.class);
}