[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,15 +1,18 @@
--- a/NeoForge/src/main/java/com/hypherionmc/craterlib/client/NeoForgeClientHelper.java
+++ /dev/null
@@ -1,61 +1,0 @@
@@ -1,69 +1,0 @@
-package com.hypherionmc.craterlib.client;
-
-import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
-import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
-import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
-import com.hypherionmc.craterlib.core.config.AbstractConfig;
-import com.hypherionmc.craterlib.core.config.ConfigController;
-import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
-import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
-import com.hypherionmc.craterlib.core.event.CraterEventBus;
-import com.hypherionmc.craterlib.core.platform.ClientPlatform;
-import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
-import com.hypherionmc.craterlib.nojang.client.BridgedMinecraft;
-import com.hypherionmc.craterlib.nojang.client.BridgedOptions;
-import com.hypherionmc.craterlib.nojang.client.multiplayer.BridgedClientLevel;
@@ -55,9 +58,14 @@
- CraterEventBus.INSTANCE.postEvent(event);
-
- ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
- if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
- AbstractConfig config = watcher.getLeft();
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((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))));
- }
- });
- }