From 1119f6c3cf421da2f2db92873efae8135c76b678 Mon Sep 17 00:00:00 2001
From: HsiangNianian <i@jyunko.cn>
Date: Fri, 16 Jan 2026 18:38:47 +0800
Subject: feat: enhance Java version management for Minecraft versions

Added functionality to determine and validate the required Java version for Minecraft versions, including checks for compatibility with older versions. Implemented event emissions for version installation and deletion, and updated the UI to reflect Java version requirements and installation status. Improved version metadata handling and added support for deleting versions.
---
 ui/src/components/ModLoaderSelector.svelte | 38 +++++++++++++++++-------------
 1 file changed, 22 insertions(+), 16 deletions(-)

(limited to 'ui/src/components/ModLoaderSelector.svelte')

diff --git a/ui/src/components/ModLoaderSelector.svelte b/ui/src/components/ModLoaderSelector.svelte
index e9d147b..34f6f2e 100644
--- a/ui/src/components/ModLoaderSelector.svelte
+++ b/ui/src/components/ModLoaderSelector.svelte
@@ -291,7 +291,12 @@
         
     {:else if selectedLoader === "fabric"}
         <div class="space-y-4 animate-in fade-in slide-in-from-bottom-2 duration-300">
-        <div>
+        {#if fabricLoaders.length === 0}
+            <div class="text-center p-4 text-sm text-zinc-500 italic">
+            No Fabric versions available for {selectedGameVersion}
+            </div>
+        {:else}
+            <div>
             <label for="fabric-loader-select" class="block text-[10px] uppercase font-bold text-zinc-500 mb-2"
             >Loader Version</label
             >
@@ -339,21 +344,22 @@
                     </div>
                 {/if}
             </div>
-        </div>
-        
-        <button
-            class="w-full bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed text-white py-2.5 px-4 rounded-sm font-bold text-sm transition-all flex items-center justify-center gap-2"
-            onclick={installModLoader}
-            disabled={isInstalling || !selectedFabricLoader}
-        >
-            {#if isInstalling}
-                <Loader2 class="animate-spin" size={16} />
-                Installing...
-            {:else}
-                <Download size={16} />
-                Install Fabric {selectedFabricLoader}
-            {/if}
-        </button>
+            </div>
+            
+            <button
+                class="w-full bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed text-white py-2.5 px-4 rounded-sm font-bold text-sm transition-all flex items-center justify-center gap-2"
+                onclick={installModLoader}
+                disabled={isInstalling || !selectedFabricLoader}
+            >
+                {#if isInstalling}
+                    <Loader2 class="animate-spin" size={16} />
+                    Installing...
+                {:else}
+                    <Download size={16} />
+                    Install Fabric {selectedFabricLoader}
+                {/if}
+            </button>
+        {/if}
         </div>
         
     {:else if selectedLoader === "forge"}
-- 
cgit v1.2.3-70-g09d2

