Skip to content

Commit

Permalink
Avoid weird double initialization in Forge 47.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed May 11, 2024
1 parent baac174 commit c101ef0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/io/github/gaming32/worldhost/WorldHost.java
Expand Up @@ -873,8 +873,13 @@ private static Path getGameDir() {
//$$ @Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
//#endif
//$$ public static class ClientModEvents {
//$$ // Forge 47.1.3 can call FMLClientSetupEvent twice.
//$$ private static boolean initialized = false;
//$$
//$$ @SubscribeEvent
//$$ public static void onClientSetup(FMLClientSetupEvent event) {
//$$ public static synchronized void onClientSetup(FMLClientSetupEvent event) {
//$$ if (initialized) return;
//$$ initialized = true;
//$$ init();
//$$ final BiFunction<Minecraft, Screen, Screen> screenFunction =
//$$ (mc, screen) -> new WorldHostConfigScreen(screen);
Expand Down
6 changes: 6 additions & 0 deletions version.gradle.kts
Expand Up @@ -139,6 +139,12 @@ unimined.minecraft {
remap(tasks.shadeDowngradedApi.get(), "remapJar")
tasks.assemble.get().dependsOn("remapJar")
}

runs {
config("client") {
javaVersion = JavaVersion.VERSION_21
}
}
}
val minecraft = unimined.minecrafts[sourceSets.main.get()]

Expand Down

0 comments on commit c101ef0

Please sign in to comment.