modpack export and chunky/DH exchange
This commit is contained in:
parent
ccf6712feb
commit
1dcb51b484
2 changed files with 90 additions and 0 deletions
82
instances/forge-1.20.1-survival/export_modpack.py
Executable file
82
instances/forge-1.20.1-survival/export_modpack.py
Executable file
|
|
@ -0,0 +1,82 @@
|
|||
#!/usr/bin/env python3
|
||||
import os
|
||||
import zipfile
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
# --- CONFIGURATION ---
|
||||
# Folders to include in the backup zip
|
||||
INCLUDE_DIRS = [
|
||||
"mods",
|
||||
"config",
|
||||
"kubejs",
|
||||
"defaultconfigs",
|
||||
"resourcepacks",
|
||||
"shaderpacks",
|
||||
"fancymenu_data", # Common layout mod folder
|
||||
]
|
||||
|
||||
# Root files to include
|
||||
INCLUDE_FILES = [
|
||||
"options.txt",
|
||||
"optionsshaders.txt",
|
||||
"optionsof.txt",
|
||||
]
|
||||
|
||||
def create_modpack_zip():
|
||||
# Use current working directory where the script is executed
|
||||
base_dir = Path.cwd()
|
||||
|
||||
# Generate timestamped filename
|
||||
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
output_filename = f"Modpack_Export_{timestamp}.zip"
|
||||
output_filepath = base_dir / output_filename
|
||||
|
||||
print("=========================================")
|
||||
print(f"📦 Packaging Modpack from: {base_dir}")
|
||||
print("=========================================\n")
|
||||
|
||||
files_added = 0
|
||||
|
||||
# Create ZIP using DEFLATED compression
|
||||
with zipfile.ZipFile(output_filepath, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
||||
|
||||
# 1. Process Folders
|
||||
for folder_name in INCLUDE_DIRS:
|
||||
folder_path = base_dir / folder_name
|
||||
if folder_path.is_dir():
|
||||
print(f" [+] Adding folder: {folder_name}/")
|
||||
for root, dirs, files in os.walk(folder_path):
|
||||
for file in files:
|
||||
file_path = Path(root) / file
|
||||
# Preserve relative path inside zip
|
||||
arcname = file_path.relative_to(base_dir)
|
||||
zipf.write(file_path, arcname)
|
||||
files_added += 1
|
||||
else:
|
||||
print(f" [-] Skipping (folder not found): {folder_name}/")
|
||||
|
||||
print()
|
||||
|
||||
# 2. Process Files
|
||||
for file_name in INCLUDE_FILES:
|
||||
file_path = base_dir / file_name
|
||||
if file_path.is_file():
|
||||
print(f" [+] Adding file: {file_name}")
|
||||
zipf.write(file_path, file_name)
|
||||
files_added += 1
|
||||
else:
|
||||
print(f" [-] Skipping (file not found): {file_name}")
|
||||
|
||||
print("\n=========================================")
|
||||
if files_added > 0:
|
||||
file_size_mb = output_filepath.stat().st_size / (1024 * 1024)
|
||||
print(f"✅ SUCCESS! Packaged {files_added} files.")
|
||||
print(f"💾 Saved as: {output_filename} ({file_size_mb:.2f} MB)")
|
||||
else:
|
||||
print("⚠️ WARNING: No files found to package. Check your execution folder.")
|
||||
output_filepath.unlink(missing_ok=True) # Remove empty zip
|
||||
print("=========================================")
|
||||
|
||||
if __name__ == "__main__":
|
||||
create_modpack_zip()
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
| **Create Addition** | `runtime/data/config/createaddition-common.toml` | `generator_efficiency` | `0.5` | Tech power generation rebalance |
|
||||
| **Sophisticated Backpacks** | `runtime/data/config/sophisticatedbackpacks-common.toml` | `enabledItems` | Tier 3/4 upgrades = `false` | Cap portable storage capacity |
|
||||
| **JourneyMap** | `runtime/data/journeymap/server/6.0/*.config` | `radarEnabled` | `"Disabled"` | Disable radar and wallhacks |
|
||||
| **Distant Horizons** | `runtime/data/config/DistantHorizons.toml` | `distanceGeneratorMode` | `"FULL"` | Pregenerate both vanilla chunks & LODs without Chunky |
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -80,3 +81,10 @@
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 6. Distant Horizons (`runtime/data/config/DistantHorizons.toml`)
|
||||
```toml
|
||||
[client.advanced.worldGenerator]
|
||||
# Set to FULL to generate both vanilla chunks and LODs during server pregen (/dh pregen start)
|
||||
distanceGeneratorMode = "FULL"
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue