This commit is contained in:
APEX FIGHT 2025-03-10 21:14:03 -04:00
parent a1a0aad106
commit e6491a0840
5 changed files with 414 additions and 0 deletions

29
main.js Normal file
View File

@ -0,0 +1,29 @@
const fs = require('fs');
const cp = require('child_process');
const yaml = require('yamljs');
var registry = {}; //registry of mods downloaded
var mods = fs.readFileSync("./mods.json", 'utf-8');
mods = JSON.parse(mods);
var modList = mods.mod_list;
var modDownloads = mods.mod_downloads;
modList.forEach((ele, idx, arr) => {
let link = modDownloads[ele];
let modinfo = {
modName: ""
}
let output = cp.execSync("cd /root/mcserver/mods && wget --content-disposition " + link).toString('utf-8'); //change dir and download mod
modinfo.modName = output.match(/(["'])(?:(?=(\\?))\2.)*?\1/, )[0];//kill myself?
modinfo.modName = modinfo.modName.substring(1, modinfo.modName.length - 1);
registry[ele] = modinfo;
});
fs.writeFileSync("/root/mcserver/mods/modRegistry.yaml", yaml.stringify(registry));

206
mods.yaml Normal file
View File

@ -0,0 +1,206 @@
non_voted:
- botany_pots
- trashcans
- corail_tombstone
- figura
- customizeable_player_models
- ftb_essentials
- ftb_teams
- ftb_chunks
- spartan_weaponry_iceandfire
- spartan_weaponry_aether
- polymorph
- toms_create_terminals
- almost_unified
vote_winners:
- waystones
- dimensional_doors
- ice_and_fire
- pams_harvest_craft_food_core
- pams_harvest_craft_trees
- pams_harvest_craft_crops
- pams_harvest_craft_food_extended
- sophisticated_backpacks
- sophisticated_storage
- snad
- apotheosis
- supplementaries
- supplementaries_additions
- spartan_weaponry
- toms_simple_storage
- artifacts
- dark_utilities
- easy_villagers
- evilcraft
- valkrien_skies
- eureka
- macaws_doors
- macaws_fences_and_walls
- macaws_windows
- macaws_trapdoors
- macaws_furniture
- macaws_lights_and_lamps
- macaws_paintings
- macaws_paths_and_pavings
- aether
- aether_villages
- create
- create_estrogen
- create_steam_n_rails
- create_crafts_and_additions
- create_bells_and_whistles
- create_interiors
dependencies:
- cyclops_core
- bookshelf
- runelic
- pig_pen_cipher
- curios
- ftb_library
- sophisticated_core
- balm
- architectury
- cloth_config
- citadel
- placebo
- patchouli
- apothic_attributes
- moonlight_lib
- kotlin_forge
minecraft_version: 1.20.1
mod_loader: forge
loader_dl: 'https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.4.0/forge-1.20.1-47.4.0-installer.jar'
mod_downloads:
corail_tombstone: 'https://www.curseforge.com/api/v1/mods/243707/files/6262536/download'
trashcans: 'https://www.curseforge.com/api/v1/mods/394535/files/4712179/download'
figura: 'client'
customizeable_player_models: 'https://www.curseforge.com/api/v1/mods/439870/files/6189210/download'
ftb_library: 'https://www.curseforge.com/api/v1/mods/404465/files/6164053/download'
ftb_essentials: 'https://www.curseforge.com/api/v1/mods/410811/files/4896152/download'
ftb_teams: 'https://www.curseforge.com/api/v1/mods/404468/files/6130786/download'
ftb_chunks: 'https://www.curseforge.com/api/v1/mods/314906/files/6160246/download'
waystones: 'https://www.curseforge.com/api/v1/mods/245755/files/6270584/download'
balm: 'https://www.curseforge.com/api/v1/mods/531761/files/6224877/download'
dimensional_doors: 'https://www.curseforge.com/api/v1/mods/284876/files/6021825/download'
cloth_config: 'https://www.curseforge.com/api/v1/mods/348521/files/5729105/download'
architectury: 'https://www.curseforge.com/api/v1/mods/419699/files/5137938/download'
ice_and_fire: 'https://www.curseforge.com/api/v1/mods/264231/files/5633453/download'
citadel: 'https://www.curseforge.com/api/v1/mods/331936/files/6002521/download'
pams_harvest_craft_food_core: 'https://www.curseforge.com/api/v1/mods/372534/files/5097798/download'
pams_harvest_craft_trees: 'https://www.curseforge.com/api/v1/mods/365460/files/4625518/download'
pams_harvest_craft_crops: 'https://www.curseforge.com/api/v1/mods/361385/files/4687624/download'
pams_harvest_craft_food_extended: 'https://www.curseforge.com/api/v1/mods/402231/files/5147171/download'
sophisticated_backpacks: 'https://www.curseforge.com/api/v1/mods/422301/files/6246607/download'
sophisticated_storage: 'https://www.curseforge.com/api/v1/mods/619320/files/6217888/download'
sophisticated_core: 'https://www.curseforge.com/api/v1/mods/618298/files/6266807/download'
snad: 'https://www.curseforge.com/api/v1/mods/912282/files/5827323/download'
apotheosis: 'https://www.curseforge.com/api/v1/mods/313970/files/6147871/download'
placebo: 'https://www.curseforge.com/api/v1/mods/283644/files/6274231/download'
patchouli: 'https://www.curseforge.com/api/v1/mods/306770/files/6164575/download'
apothic_attributes: 'https://www.curseforge.com/api/v1/mods/898963/files/5634071/download'
supplementaries: 'https://www.curseforge.com/api/v1/mods/412082/files/6255734/download'
supplementaries_additions: 'https://www.curseforge.com/api/v1/mods/838411/files/6280155/download'
moonlight_lib: 'https://www.curseforge.com/api/v1/mods/499980/files/6283242/download'
spartan_weaponry: 'https://www.curseforge.com/api/v1/mods/278141/files/5597663/download'
spartan_weaponry_iceandfire: 'https://www.curseforge.com/api/v1/mods/606315/files/5608442/download'
spartan_weaponry_aether: 'https://www.curseforge.com/api/v1/mods/1062314/files/5686127/download'
toms_simple_storage: 'https://www.curseforge.com/api/v1/mods/378609/files/6093707/download'
toms_create_terminals: 'https://www.curseforge.com/api/v1/mods/1059879/files/6252786/download'
almost_unified: 'https://www.curseforge.com/api/v1/mods/633823/files/5517426/download'
polymorph: 'https://www.curseforge.com/api/v1/mods/388800/files/5995253/download'
artifacts: 'https://www.curseforge.com/api/v1/mods/312353/files/5693342/download'
curios: 'https://www.curseforge.com/api/v1/mods/309927/files/6238756/download'
dark_utilities: 'https://www.curseforge.com/api/v1/mods/242195/files/5754567/download'
bookshelf: 'https://www.curseforge.com/api/v1/mods/228525/files/5423987/download'
runelic: 'https://www.curseforge.com/api/v1/mods/393149/files/4714779/download'
pig_pen_cipher: 'https://www.curseforge.com/api/v1/mods/396234/files/4714775/download'
easy_villagers: 'https://www.curseforge.com/api/v1/mods/400514/files/5724570/download'
evilcraft: 'https://www.curseforge.com/api/v1/mods/74610/files/6287068/download'
cyclops_core: 'https://www.curseforge.com/api/v1/mods/232758/files/6199446/download'
botany_pots: 'https://www.curseforge.com/api/v1/mods/353928/files/6002825/download'
kotlin_forge: 'https://www.curseforge.com/api/v1/mods/351264/files/5402061/download'
valkrien_skies: 'https://www.curseforge.com/api/v1/mods/258371/files/5212232/download'
eureka: 'https://www.curseforge.com/api/v1/mods/654384/files/5321630/download'
macaws_doors: 'https://www.curseforge.com/api/v1/mods/378646/files/6146379/download'
macaws_fences_and_walls: 'https://www.curseforge.com/api/v1/mods/453925/files/5442217/download'
macaws_windows: 'https://www.curseforge.com/api/v1/mods/363569/files/5589363/download'
macaws_trapdoors: 'https://www.curseforge.com/api/v1/mods/400933/files/5977657/download'
macaws_furniture: 'https://www.curseforge.com/api/v1/mods/359540/files/5589873/download'
macaws_lights_and_lamps: 'https://www.curseforge.com/api/v1/mods/502372/files/5450327/download'
macaws_paintings: 'https://www.curseforge.com/api/v1/mods/438116/files/4848151/download'
macaws_paths_and_pavings: 'https://www.curseforge.com/api/v1/mods/629153/files/6244135/download'
aether: 'https://www.curseforge.com/api/v1/mods/255308/files/6134920/download'
aether_villages: 'https://www.curseforge.com/api/v1/mods/1073197/files/5707985/download'
create: 'https://www.curseforge.com/api/v1/mods/328085/files/6271934/download'
create_estrogen: 'https://www.curseforge.com/api/v1/mods/850410/files/6280515/download'
create_steam_n_rails: 'https://www.curseforge.com/api/v1/mods/688231/files/5840017/download'
create_crafts_and_additions: 'https://www.curseforge.com/api/v1/mods/439890/files/6256349/download'
create_bells_and_whistles: 'https://www.curseforge.com/api/v1/mods/905040/files/6280659/download'
create_interiors: 'https://www.curseforge.com/api/v1/mods/906239/files/5694662/download'
mod_list:
- botany_pots
- trashcans
- corail_tombstone
- figura
- customizeable_player_models
- ftb_essentials
- ftb_teams
- ftb_chunks
- spartan_weaponry_iceandfire
- spartan_weaponry_aether
- polymorph
- toms_create_terminals
- almost_unified
- waystones
- dimensional_doors
- ice_and_fire
- pams_harvest_craft_food_core
- pams_harvest_craft_trees
- pams_harvest_craft_crops
- pams_harvest_craft_food_extended
- sophisticated_backpacks
- sophisticated_storage
- snad
- apotheosis
- supplementaries
- supplementaries_additions
- spartan_weaponry
- toms_simple_storage
- artifacts
- dark_utilities
- easy_villagers
- evilcraft
- valkrien_skies
- eureka
- macaws_doors
- macaws_fences_and_walls
- macaws_windows
- macaws_trapdoors
- macaws_furniture
- macaws_lights_and_lamps
- macaws_paintings
- macaws_paths_and_pavings
- aether
- aether_villages
- create
- create_estrogen
- create_steam_n_rails
- create_crafts_and_additions
- create_bells_and_whistles
- create_interiors
- cyclops_core
- bookshelf
- runelic
- pig_pen_cipher
- curios
- ftb_library
- sophisticated_core
- balm
- architectury
- cloth_config
- citadel
- placebo
- patchouli
- apothic_attributes
- moonlight_lib
- kotlin_forge

147
package-lock.json generated Normal file
View File

@ -0,0 +1,147 @@
{
"name": "js",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "js",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"yamljs": "^0.3.0"
}
},
"node_modules/argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"license": "MIT",
"dependencies": {
"sprintf-js": "~1.0.2"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"license": "MIT"
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"license": "ISC"
},
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"deprecated": "Glob versions prior to v9 are no longer supported",
"license": "ISC",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
"license": "ISC",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"license": "ISC"
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"license": "ISC",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"license": "ISC",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
"license": "BSD-3-Clause"
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"license": "ISC"
},
"node_modules/yamljs": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz",
"integrity": "sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==",
"license": "MIT",
"dependencies": {
"argparse": "^1.0.7",
"glob": "^7.0.5"
},
"bin": {
"json2yaml": "bin/json2yaml",
"yaml2json": "bin/yaml2json"
}
}
}
}

14
package.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "js",
"version": "1.0.0",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"yamljs": "^0.3.0"
}
}

18
test.js Normal file
View File

@ -0,0 +1,18 @@
const fs = require('fs');
let output = fs.readFileSync("./out", 'utf-8');
let modinfo = {
modName: ""
}
modinfo.modName = output.match(/(["'])(?:(?=(\\?))\2.)*?\1/, )[0];
modinfo.modName = modinfo.modName.substring(1, modinfo.modName.length - 1)
console.log(modinfo.modName);