[BUG] Fix Config watcher using too many threads and not detecting changes on Linux systems

This commit is contained in:
2025-03-13 15:01:19 +02:00
parent 1a48fb6d33
commit 23720f6629
65 changed files with 186 additions and 178 deletions

View File

@@ -29,9 +29,8 @@ 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.getWatchedConfigs().forEach((conf, watcher) -> {
ConfigController.getWatchedConfigs().forEach((conf, config) -> {
if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
AbstractConfig config = watcher.getLeft();
if (config.getModId().equals(selectedMod.getModId())) {
cir.setReturnValue(
Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))