jaen-united-2024/manifest

121 lines
3.4 KiB
Plaintext

const vars = {
version: "1.13.0",
id: "mcjaen2024",
icon: "https://git.ragestudio.net/srgooglo/jaen-united-2024/raw/branch/main/icon.gif",
name: "Jaen United Server",
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,
}
const fs = require("node:fs")
module.exports = {
...vars,
rsb_minimun_version: "0.11.2",
import_libs: [
"mcl",
"ipc",
],
configs: {
username: {
label: "Username",
type: "string",
default: defaultConfig.username,
icon: "MdPerson",
string_trim: true,
ui_component_props: {
maxLength: 16,
showCount: true
}
},
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_ask_configs: [
"username"
],
install_steps: {
git_clones: [
{
path: ".",
url: internalVars.git_source
}
]
},
update_steps: {
git_reset: [
{
path: ".",
from: "HEAD",
}
]
},
executable: true,
check_updates_after_execute: true,
after_install: async (pkg) => {
// patch options.txt from default_options.txt
const defaultOptionsPath = `${pkg.install_path}/default_options.txt`
const finalOptionsPath = `${pkg.install_path}/options.txt`
fs.copyFileSync(defaultOptionsPath, finalOptionsPath)
},
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`,
},
{
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,
})
}
})
}
}