120 lines
3.5 KiB
Plaintext
120 lines
3.5 KiB
Plaintext
const vars = {
|
|
id: "mcjaen2024",
|
|
icon: "https://git.ragestudio.net/srgooglo/jaen-united-2024/raw/branch/main/icon.gif",
|
|
name: "Jaen United Server",
|
|
version: "1.1.0",
|
|
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: {
|
|
number: "1.20.1",
|
|
type: "release",
|
|
}
|
|
}
|
|
|
|
const defaultConfig = {
|
|
username: "Oliva Salvaje",
|
|
assigned_memory: 4096,
|
|
}
|
|
|
|
module.exports = {
|
|
...vars,
|
|
rsb_minimun_version: "0.9.0",
|
|
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_pulls: [
|
|
{
|
|
path: ".",
|
|
url: internalVars.git_source
|
|
}
|
|
]
|
|
},
|
|
executable: true,
|
|
check_updates_after_execute: true,
|
|
execute: async (pkg) => {
|
|
console.log(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: {
|
|
number: internalVars.mc_version.number,
|
|
type: internalVars.mc_version.type
|
|
},
|
|
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,
|
|
},
|
|
},
|
|
customLaunchArgs: [
|
|
`--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,
|
|
})
|
|
}
|
|
})
|
|
}
|
|
} |