[DEV] New Cloth Config GUIs, new nojang apis, and bug fixes
This commit is contained in:
@@ -5,6 +5,8 @@ dependencies {
|
||||
// Compat
|
||||
// NOT AVAILABLE ON FORGE modImplementation("maven.modrinth:vanishmod:${vanishmod}")
|
||||
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-forge:${cloth_config}")
|
||||
|
||||
// Do not edit or remove
|
||||
implementation project(":Common")
|
||||
}
|
||||
@@ -113,4 +115,12 @@ publisher {
|
||||
setArtifact(remapJar)
|
||||
setCurseEnvironment("both")
|
||||
setIsManualRelease(true)
|
||||
|
||||
curseDepends {
|
||||
optional("cloth-config")
|
||||
}
|
||||
|
||||
modrinthDepends {
|
||||
optional("cloth-config")
|
||||
}
|
||||
}
|
@@ -29,13 +29,14 @@ public class ConfigScreenHandlerMixin {
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
ConfigController.getMonitoredConfigs().forEach((conf, watcher) -> {
|
||||
if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
ModuleConfig config = (ModuleConfig) conf;
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
);
|
||||
}
|
||||
AbstractConfig config = watcher.getLeft();
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
} else {
|
||||
//ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user