File tree Expand file tree Collapse file tree
src/main/java/ca/spottedleaf/moonrise/neoforge Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ neoForge {
3838 }
3939}
4040
41+ val gui = rootProject.property(" enable_gui" ).toString() == " true"
42+
4143dependencies {
4244 runtimeOnly(rootProject.sourceSets.main.get().output)
4345 shadow(project(" :" ))
@@ -48,8 +50,12 @@ dependencies {
4850 libs(libs.snakeyaml)
4951 " additionalRuntimeClasspath" (libs.snakeyaml)
5052
51- implementation(libs.clothConfig.neoforge)
52- jarJar(libs.clothConfig.neoforge)
53+ if (gui) {
54+ implementation(libs.clothConfig.neoforge)
55+ jarJar(libs.clothConfig.neoforge)
56+ } else {
57+ compileOnly(libs.clothConfig.neoforge)
58+ }
5359}
5460
5561tasks.processResources {
Original file line number Diff line number Diff line change 44import ca .spottedleaf .moonrise .patches .command .MoonriseCommand ;
55import com .mojang .brigadier .CommandDispatcher ;
66import net .neoforged .bus .api .IEventBus ;
7+ import net .neoforged .fml .ModList ;
78import net .neoforged .fml .ModLoadingContext ;
89import net .neoforged .fml .common .Mod ;
910import net .neoforged .fml .event .lifecycle .FMLClientSetupEvent ;
@@ -16,13 +17,19 @@ public final class MoonriseNeoForge {
1617 @ SuppressWarnings ({"rawtypes" , "unchecked" })
1718 public MoonriseNeoForge (final IEventBus modBus ) {
1819 modBus .addListener (FMLClientSetupEvent .class , event -> {
19- ModLoadingContext .get ().registerExtensionPoint (
20- IConfigScreenFactory .class ,
21- () -> (modContainer , parent ) -> MoonriseConfigScreen .create (parent )
22- );
20+ if (hasCloth ()) {
21+ ModLoadingContext .get ().registerExtensionPoint (
22+ IConfigScreenFactory .class ,
23+ () -> (modContainer , parent ) -> MoonriseConfigScreen .create (parent )
24+ );
25+ }
2326 NeoForge .EVENT_BUS .addListener ((final RegisterClientCommandsEvent commandsEvent ) -> {
2427 MoonriseCommand .registerClient ((CommandDispatcher ) commandsEvent .getDispatcher ());
2528 });
2629 });
2730 }
31+
32+ private static boolean hasCloth () {
33+ return ModList .get ().isLoaded ("cloth_config" );
34+ }
2835}
You can’t perform that action at this time.
0 commit comments