added manifest v2
This commit is contained in:
parent
c4fcfa25fc
commit
93bf0a238e
|
@ -0,0 +1,72 @@
|
||||||
|
class Manifest {
|
||||||
|
static useLib = ["path", "fs", "auth", "mcl"]
|
||||||
|
|
||||||
|
static id = "hfmc"
|
||||||
|
static pkg_name = "Hispano Furs MC"
|
||||||
|
static version = "0.1.0"
|
||||||
|
static description = "A Minecraft modpack"
|
||||||
|
static icon = "https://git.ragestudio.net/srgooglo/hfmc-dev/raw/branch/main/icon.png"
|
||||||
|
static license = "unlicensed"
|
||||||
|
static author = "HispanoFurs"
|
||||||
|
static core_minimum_version = "0.16.0"
|
||||||
|
|
||||||
|
static git_remote = "https://git.ragestudio.net/srgooglo/hfmc-dev"
|
||||||
|
|
||||||
|
static vars = {
|
||||||
|
auth: {
|
||||||
|
login: "https://hispanofurs.comty.app/auth",
|
||||||
|
fetcher: "https://hispanofurs.comty.app/rsauthorize",
|
||||||
|
getter: "https://hispanofurs_api.comty.app/data",
|
||||||
|
},
|
||||||
|
memory: {
|
||||||
|
min: 2048,
|
||||||
|
max: Config.get("memory")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
authService = {
|
||||||
|
...Manifest.vars.auth
|
||||||
|
}
|
||||||
|
|
||||||
|
installSteps = [
|
||||||
|
{
|
||||||
|
type: "git_clone",
|
||||||
|
url: Manifest.git_remote,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
updateSteps = {
|
||||||
|
git_reset: [
|
||||||
|
{
|
||||||
|
from: "HEAD"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
async afterInstall() {
|
||||||
|
const defaultOptionsPath = `${install_path}/default_options.txt`
|
||||||
|
const finalOptionsPath = `${install_path}/options.txt`
|
||||||
|
|
||||||
|
fs.copyFileSync(defaultOptionsPath, finalOptionsPath)
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
let auth = await Lib.auth.get()
|
||||||
|
|
||||||
|
if (!auth) {
|
||||||
|
return await Lib.auth.request()
|
||||||
|
}
|
||||||
|
|
||||||
|
auth = await Lib.mcl.auth(auth.assigned_username)
|
||||||
|
|
||||||
|
return await Lib.mcl.launch(
|
||||||
|
{
|
||||||
|
javaPath: Vars.binaries.java_jre_bin,
|
||||||
|
root: install_path,
|
||||||
|
authorization: auth,
|
||||||
|
memory: Manifest.vars.memory,
|
||||||
|
forge: `${install_path}/forge-installer.jar`,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue