Skip to content

Commit

Permalink
Merge pull request #1222 from Oganesson897/packwiz
Browse files Browse the repository at this point in the history
Refine buildscript
  • Loading branch information
bruberu authored Jan 15, 2025
2 parents a693a26 + db7f3ba commit fbe879c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 14,329 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ usercache.json
usernamecache.json
minecraftinstance.json
instance.json
index.toml

*.log
*.txt
Expand Down
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,7 @@ Special thanks to our volunteers:
- Client only mod: [rewrite <mod>.pw.toml#side manually](https://packwiz.infra.link/reference/pack-format/mod-toml/#properties)

## Building the pack
### Client Pack
1. Download [Packwiz](https://packwiz.infra.link/installation/) to the current directory.
2. Run `packwiz cf export` to export the client pack.
3. The export pack will generate in the root directory.
### Server Pack
> Server pack is not recommended for manually install. Recommended to go to the release page to download.
1. Download [packwiz-installer-bootstrap](./build/server/packwiz-installer-bootstrap.jar) to a new directory.
2. Run `java -jar packwiz-installer-bootstrap.jar <local refreshed pack.toml>` to install server.
3. Download [forge installer](https://files.minecraftforge.net/net/minecraftforge/forge/index_1.12.2.html) and run it manually to download libraries and server jar.
4. Copy [launch.sh](./build/server/launch.sh) to the server directory.
1. Please download [Packwiz](https://packwiz.infra.link/installation/) to the current directory manually.
2. Run `pip install requests` first to install required package.
3. Run `python build/main.py`.
4. Check `buildOut` folder.
32 changes: 26 additions & 6 deletions build/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import argparse
# if there is a problem with building, please let htmlcsjs know
import os
import sys
import shutil
import subprocess
import zipfile
Expand Down Expand Up @@ -37,26 +38,45 @@ def parse_args():
help="makes a folder with all the files symlinked for development. probally only works on linux")
parser.add_argument("-c", "--client", action="store_true",
help="only builds the client pack")
parser.add_argument("--prefix",
type=str,
default="susy",
help="prefix applied to questbook entries, typically the modpack id, defaults to susy")
parser.add_argument("--lang",
type=str,
default="en_us",
help="what language the output language file is, defaults to en_us")

return parser.parse_args()

basePath = os.path.normpath(os.path.realpath(__file__)[:-7] + "..")

def build(args):

# Run questbook.py first
questbook.build(questbook.parse_args())
questbook.build(args)

os.makedirs('./buildOut/', exist_ok=True)

if args.clean:
shutil.rmtree(basePath + "/buildOut",
ignore_errors=True)
sys.exit(0)

refresh()
export_client_pack() # Client
export_server_pack() # Server
export_modlist() # Modlist

print("done")
if args.client:
return;

export_modlist()
export_server_pack()

def refresh():
subprocess.run(['chmod', '+x', './packwiz'], check=True)
subprocess.run(['./packwiz', 'refresh'], check=True)

def export_client_pack():
print("Client Pack Exporting")
subprocess.run(['chmod', '+x', './packwiz'], check=True)
subprocess.run(['./packwiz', 'curseforge', 'export', '-o', 'client.zip'], check=True)
shutil.copy('./client.zip', './buildOut/')
os.remove('./client.zip')
Expand Down
Loading

0 comments on commit fbe879c

Please sign in to comment.