File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11plugins {
2- id(" dev.tocraft.modmaster.root" ) version (" single-1.9 " )
2+ id(" dev.tocraft.modmaster.root" ) version (" single-1.10.1 " )
33}
44
55val clothConfigVersion: String? = properties[" cloth_config_version" ] as String
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ plugins {
22 id(" dev.tocraft.modmaster.common" )
33}
44
5- val clothConfigVersion: String? = parent!! .properties[" cloth_config_version" ] as String
5+ val clothConfigVersion: String = parent!! .properties[" cloth_config_version" ] as String
66
77repositories {
88 maven(" https://maven.terraformersmc.com/releases/" )
@@ -13,9 +13,7 @@ dependencies {
1313 // mixin extras
1414 implementation(annotationProcessor(" io.github.llamalad7:mixinextras-common:${rootProject.properties[" mixinextras_version" ]} " )!! )
1515 // Cloth Config
16- if (clothConfigVersion != null ) {
17- modCompileOnly(" me.shedaniel.cloth:cloth-config:${clothConfigVersion} " ) {
18- exclude(" net.fabricmc.fabric-api" )
19- }
16+ modCompileOnly(" me.shedaniel.cloth:cloth-config:${clothConfigVersion} " ) {
17+ exclude(" net.fabricmc.fabric-api" )
2018 }
2119}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ tasks.withType<ProcessResources> {
1515
1616val modMenuVersion: String? = parent!! .properties[" modmenu_version" ] as String
1717
18- val clothConfigVersion: String? = parent!! .properties[" cloth_config_version" ] as String
18+ val clothConfigVersion: String = parent!! .properties[" cloth_config_version" ] as String
1919
2020repositories {
2121 maven(" https://maven.terraformersmc.com/releases/" )
@@ -26,17 +26,12 @@ dependencies {
2626 // mixin extras
2727 include(implementation(annotationProcessor(" io.github.llamalad7:mixinextras-fabric:${rootProject.properties[" mixinextras_version" ]} " )!! )!! )
2828 if (modMenuVersion != null ) {
29- modCompileOnly(" com.terraformersmc:modmenu:${modMenuVersion} " ) {
30- isTransitive = false
31- }
3229 modRuntimeOnly(" com.terraformersmc:modmenu:${modMenuVersion} " ) {
3330 isTransitive = false
3431 }
3532 }
3633 // Cloth Config
37- if (clothConfigVersion != null ) {
38- modRuntimeOnly(" me.shedaniel.cloth:cloth-config-fabric:${clothConfigVersion} " ) {
39- exclude(" net.fabricmc.fabric-api" )
40- }
34+ modRuntimeOnly(" me.shedaniel.cloth:cloth-config-fabric:${clothConfigVersion} " ) {
35+ exclude(" net.fabricmc.fabric-api" )
4136 }
4237}
Original file line number Diff line number Diff line change 1+ package com .terraformersmc .modmenu .api ;
2+
3+ import net .minecraft .client .gui .screens .Screen ;
4+
5+ @ SuppressWarnings ("unused" )
6+ @ FunctionalInterface
7+ public interface ConfigScreenFactory <S extends Screen > {
8+ S create (Screen parent );
9+ }
Original file line number Diff line number Diff line change 1+ package com .terraformersmc .modmenu .api ;
2+
3+ import java .util .Map ;
4+
5+ @ SuppressWarnings ("unused" )
6+ public interface ModMenuApi {
7+ /**
8+ * Used to provide config screen factories for other mods. This takes second
9+ * priority to a mod's own config screen factory provider. For example, if
10+ * mod `xyz` supplies a config screen factory, mod `abc` providing a config
11+ * screen to `xyz` will be pointless, as the one provided by `xyz` will be
12+ * used.
13+ * <p>
14+ * This method is NOT meant to be used to add a config screen factory to
15+ * your own mod.
16+ *
17+ * @return a map of mod ids to screen factories.
18+ */
19+ default Map <String , ConfigScreenFactory <?>> getProvidedConfigScreenFactories () {
20+ return Map .of ();
21+ }
22+ /**
23+ * Used to construct a new config screen instance when your mod's
24+ * configuration button is selected on the mod menu screen. The
25+ * screen instance parameter is the active mod menu screen.
26+ *
27+ * @return A factory for constructing config screen instances.
28+ */
29+ default ConfigScreenFactory <?> getModConfigScreenFactory () {
30+ return screen -> null ;
31+ }}
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ tasks.withType<ProcessResources> {
1919 outputs.upToDateWhen { false }
2020}
2121
22- val clothConfigVersion: String? = parent!! .properties[" cloth_config_version" ] as String
22+ val clothConfigVersion: String = parent!! .properties[" cloth_config_version" ] as String
2323
2424repositories {
2525 maven(" https://maven.terraformersmc.com/releases/" )
@@ -31,7 +31,5 @@ dependencies {
3131 compileOnly(annotationProcessor(" io.github.llamalad7:mixinextras-common:${rootProject.properties[" mixinextras_version" ]} " )!! )
3232 implementation(include(" io.github.llamalad7:mixinextras-neoforge:${rootProject.properties[" mixinextras_version" ]} " )!! )
3333 // Cloth Config
34- if (clothConfigVersion != null ) {
35- modRuntimeOnly(" me.shedaniel.cloth:cloth-config-neoforge:${clothConfigVersion} " )
36- }
34+ modRuntimeOnly(" me.shedaniel.cloth:cloth-config-neoforge:${clothConfigVersion} " )
3735}
You can’t perform that action at this time.
0 commit comments