Skip to content

Commit

Permalink
Initialize modmenu compat after initial resource reload
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Oct 15, 2023
1 parent e631fe9 commit 1c10c29
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 26 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ loom.platform=forge
# Versions
versionMc=1.20.1
versionForge=47.1.3
versionConnectorExtras=1.4.0
versionConnectorExtras=1.4.1

# Publishing
curseForgeId=913445
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ public class ModMenuCompatSetup {
private static final Logger LOGGER = LogUtils.getLogger();
private static final String MODMENU_MODID = "modmenu";

private static boolean initialized = false;

public static void init() {
if (initialized) {
return;
}
initialized = true;

Map<String, ConfigScreenFactory<?>> modFactories = new HashMap<>();
List<Map<String, ConfigScreenFactory<?>>> providedFactories = new ArrayList<>();
FabricLoader.getInstance().getEntrypointContainers(MODMENU_MODID, ModMenuApi.class).forEach(container -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package dev.su5ed.sinytra.connectorextras.modmenu.mixin;

import com.mojang.realmsclient.client.RealmsClient;
import dev.su5ed.sinytra.connectorextras.modmenu.ModMenuCompatSetup;
import net.minecraft.client.Minecraft;
import net.minecraft.client.main.GameConfig;
import net.minecraft.server.packs.resources.ReloadInstance;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Minecraft.class)
public class MinecraftMixin {

@Inject(method = "lambda$new$4", at = @At("HEAD"))
private void initModMenuCompat(RealmsClient realmsclient, ReloadInstance reloadinstance, GameConfig arg, CallbackInfo ci) {
ModMenuCompatSetup.init();
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"required": true,
"package": "dev.su5ed.sinytra.connectorextras.modmenu.mixin",
"client": [
"ModListScreenMixin"
"MinecraftMixin"
]
}

0 comments on commit 1c10c29

Please sign in to comment.