[DEV] New Cloth Config GUIs, new nojang apis, and bug fixes

This commit is contained in:
2025-01-14 17:14:57 +02:00
parent 864baeb6c5
commit 8a46899769
290 changed files with 6213 additions and 459 deletions

View File

@@ -1,6 +1,6 @@
--- a/Forge/build.gradle
+++ /dev/null
@@ -1,116 +1,0 @@
@@ -1,126 +1,0 @@
-// Adjust the output jar name here
-archivesBaseName = "${mod_name.replace(" ", "")}-Forge-${minecraft_version}"
-
@@ -8,6 +8,8 @@
- // 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")
-}
@@ -116,4 +118,12 @@
- setArtifact(remapJar)
- setCurseEnvironment("both")
- setIsManualRelease(true)
-
- curseDepends {
- optional("cloth-config")
- }
-
- modrinthDepends {
- optional("cloth-config")
- }
-}

View File

@@ -1,6 +1,6 @@
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
+++ /dev/null
@@ -1,43 +1,0 @@
@@ -1,44 +1,0 @@
-package com.hypherionmc.craterlib.mixin;
-
-import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
@@ -32,13 +32,14 @@
- @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))));
- }
- });
- }