const vars = { id: "mcjaen2024", icon: "https://git.ragestudio.net/srgooglo/jaen-united-2024/raw/branch/main/icon.gif", name: "Jaen United Server", version: "1.3.3", author: "Jaen United", description: "Jaen United Minecraft modpack", } const internalVars = { public_ip: "mc.mcommunity.fun", public_ip_port: "25565", git_source: "https://git.ragestudio.net/srgooglo/jaen-united-2024", mc_version: { forge: "1.20.1-forge-47.2.17", number: "1.20.1", type: "release", } } const defaultConfig = { username: "Oliva_Salvaje", assigned_memory: 4096, } module.exports = { ...vars, rsb_minimun_version: "0.9.3", import_libs: [ "mcl", "ipc", ], configs: { username: { label: "Username", type: "string", default: defaultConfig.username, icon: "MdPerson" }, assigned_memory: { label: "Assigned Memory", type: "number", default: defaultConfig.assigned_memory, icon: "MdMemory", ui_component: "slider", ui_component_props: { min: 2048, max: 8192, step: 1024, unit: "MB" }, }, }, install_steps: { git_clones: [ { path: ".", url: internalVars.git_source } ] }, update_steps: { git_reset: [ { path: ".", from: "origin/main", } ] }, executable: true, check_updates_after_execute: true, execute: async (pkg) => { const auth = await pkg.libraries.mcl.auth((pkg.storaged_configs?.username ?? defaultConfig.username)) return pkg.libraries.mcl.launch( { root: pkg.install_path, authorization: auth, version: internalVars.mc_version, memory: { max: pkg.storaged_configs?.assigned_memory ?? defaultConfig.assigned_memory, min: 2048 }, forge: `${pkg.install_path}/forge-installer.jar`, // quickPlay: { // type: "multiplayer", // identifier: `${internalVars.public_ip}:${internalVars.public_ip_port}`, // args: { // server: internalVars.public_ip, // port: internalVars.public_ip_port, // }, // } }, { install: () => { pkg.libraries.ipc.send(`new:notification`, { message: "Downloading assets", description: "This may take a while...", loading: true, duration: 10 }) }, init_assets: () => { pkg.libraries.ipc.send(`new:message`, { message: "Preparing assets, please wait...", type: "loading", duration: 10000, }) } }) } }