Compare commits
12 Commits
v0.2.1
..
5ae6a336c1
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ae6a336c1 | |||
| 81824cf44f | |||
| 8ec387f4e3 | |||
| 23ed3e5d97 | |||
| 560217cd38 | |||
| 519e2c8f6d | |||
| f13458073e | |||
| 315746073d | |||
| d9b87f40ef | |||
| a38910cbaf | |||
| 93409a83f8 | |||
| 45d7fe07a5 |
@@ -8,7 +8,7 @@ This is the repo for FishPog Pixelmon, and a bit of experimental tooling to make
|
|||||||
git clone https://git.233hfd.com/joey/FishPogPixelmon.git
|
git clone https://git.233hfd.com/joey/FishPogPixelmon.git
|
||||||
cd FishPogPixelmon
|
cd FishPogPixelmon
|
||||||
|
|
||||||
source ./venv.sh # or just venv.bat on windows
|
source ./venv.sh # or just venv.ps1 on windows
|
||||||
|
|
||||||
python tooling.py --setup
|
python tooling.py --setup
|
||||||
```
|
```
|
||||||
@@ -21,4 +21,8 @@ now, pax will be installed, which will allow you to edit the modpack. refer to t
|
|||||||
python tooling.py --export
|
python tooling.py --export
|
||||||
```
|
```
|
||||||
|
|
||||||
this command will package up the pack with pax, then bundle some scripts with it that allows for auto-updating and automatically downloading the mods from curseforge, rather than having to distribute a large zip file.
|
## exporting the modpack client
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python tooling.py --client
|
||||||
|
```
|
||||||
|
|||||||
+12
-25
@@ -1,43 +1,30 @@
|
|||||||
|
# got to the directory where the script is located
|
||||||
|
Push-Location $PSScriptRoot
|
||||||
|
|
||||||
# check if winget is installed and if so, set a flag to true
|
# check if winget is installed and if so, set a flag to true
|
||||||
$winget = Get-Command winget -ErrorAction SilentlyContinue
|
$winget = Get-Command winget -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
# trust desktop-shortcut.ps1 for good measure
|
||||||
|
Unblock-File .\desktop-shortcut.ps1
|
||||||
|
|
||||||
if (!$winget) {
|
if (!$winget) {
|
||||||
Write-Host "Error: winget is not installed." -Foreground Red
|
Write-Host "Error: winget is not installed." -Foreground Red
|
||||||
Write-Host "This script probably will not work without winget." -Foreground Red
|
Write-Host "This script will not work without winget." -Foreground Red
|
||||||
Write-Host "Run 'Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe' in to install winget." -Foreground Red
|
Write-Host "Please install winget - trying to open Microsoft Store" -Foreground Yellow
|
||||||
Write-Host "If you do install winget, this script should handle the rest." -Foreground Red
|
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
|
||||||
}
|
Start-Process "ms-windows-store://pdp/?ProductId=9NBLGGH4NNS1"
|
||||||
|
|
||||||
# Check that python is installed
|
|
||||||
if (-not (Get-Command "python" -ErrorAction SilentlyContinue)) {
|
|
||||||
Write-Host "Error: python is not installed." -Foreground Red
|
|
||||||
|
|
||||||
if ($winget) {
|
|
||||||
Write-Host "Attempting to install python."
|
|
||||||
(winget install --id=Python.Python.3.11 -e) | Out-Null
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Host "Please install python to continue." -Foreground Red
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check that java is installed
|
# Check that java is installed
|
||||||
if (-not (Get-Command "C:\Program Files\AdoptOpenJDK\jdk-11.0.11.9-hotspot\bin\java" -ErrorAction SilentlyContinue)) {
|
if (-not (Get-Command "C:\Program Files\AdoptOpenJDK\jdk-11.0.11.9-hotspot\bin\java" -ErrorAction SilentlyContinue)) {
|
||||||
Write-Host "Error: java is not installed." -Foreground Red
|
Write-Host "Error: java is not installed." -Foreground Red
|
||||||
|
|
||||||
if ($winget) {
|
|
||||||
Write-Host "Attempting to install java."
|
Write-Host "Attempting to install java."
|
||||||
(winget install AdoptOpenJDK.OpenJDK.11) | Out-Null
|
winget install AdoptOpenJDK.OpenJDK.11
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Host "Please install java to continue." -Foreground Red
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Test-Path ".venv") { } else { python -m venv .venv }
|
if (-not (Test-Path ".venv")) { python -m venv .venv }
|
||||||
|
|
||||||
. .\.venv\Scripts\Activate.ps1
|
. .\.venv\Scripts\Activate.ps1
|
||||||
|
|
||||||
|
|||||||
+10
-7
@@ -10,14 +10,17 @@ MOD_DOWNLOADER_URL = "https://github.com/Joshyx/ModpackDownloader/releases/downl
|
|||||||
|
|
||||||
MODPACK_RELEASES_URL = "https://git.233hfd.com/api/v1/repos/joey/FishPogPixelmon/releases?limit=1"
|
MODPACK_RELEASES_URL = "https://git.233hfd.com/api/v1/repos/joey/FishPogPixelmon/releases?limit=1"
|
||||||
|
|
||||||
|
DELETION_EXEMPTED_MODS = ["TrainerCommands-1.16.5-2.6.0.jar", "OptiFine_1.16.5_HD_U_G8.jar"]
|
||||||
|
|
||||||
MULTIMC_DOWNLOAD_URL_WINDOWS = "https://files.multimc.org/downloads/mmc-develop-win32.zip"
|
MULTIMC_DOWNLOAD_URL_WINDOWS = "https://files.multimc.org/downloads/mmc-develop-win32.zip"
|
||||||
MULTIMC_PARENT_DIR = ""
|
MULTIMC_PARENT_DIR = ""
|
||||||
MULTIMC_DIR = ""
|
MULTIMC_DIR = ""
|
||||||
INSTANCE_DIR = ""
|
INSTANCE_DIR = ""
|
||||||
|
|
||||||
if OS == "darwin":
|
if OS == "darwin":
|
||||||
cprint("no support for macos yet", "red")
|
MULTIMC_PARENT_DIR = "/Applications/MultiMC.app"
|
||||||
exit(1)
|
MULTIMC_DIR = f"{MULTIMC_PARENT_DIR}/Data"
|
||||||
|
INSTANCE_DIR = f"{MULTIMC_DIR}/instances/FishPogPixelmon"
|
||||||
|
|
||||||
if OS == "linux":
|
if OS == "linux":
|
||||||
MULTIMC_PARENT_DIR = f"{os.getenv('HOME')}/.local/share"
|
MULTIMC_PARENT_DIR = f"{os.getenv('HOME')}/.local/share"
|
||||||
@@ -25,7 +28,7 @@ if OS == "linux":
|
|||||||
INSTANCE_DIR = f"{MULTIMC_DIR}/instances/FishPogPixelmon"
|
INSTANCE_DIR = f"{MULTIMC_DIR}/instances/FishPogPixelmon"
|
||||||
|
|
||||||
if OS == "win32":
|
if OS == "win32":
|
||||||
MULTIMC_PARENT_DIR = f"{os.getenv('APPDATA')}\\FishPog"
|
MULTIMC_PARENT_DIR = os.getcwd()
|
||||||
MULTIMC_DIR = f"{MULTIMC_PARENT_DIR}\\MultiMC"
|
MULTIMC_DIR = f"{MULTIMC_PARENT_DIR}\\MultiMC"
|
||||||
INSTANCE_DIR = f"{MULTIMC_DIR}\\instances\\FishPogPixelmon"
|
INSTANCE_DIR = f"{MULTIMC_DIR}\\instances\\FishPogPixelmon"
|
||||||
|
|
||||||
@@ -51,6 +54,9 @@ def run_mmc():
|
|||||||
if OS == "linux":
|
if OS == "linux":
|
||||||
subprocess.Popen(["./MultiMC"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
subprocess.Popen(["./MultiMC"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
|
||||||
|
if OS == "darwin":
|
||||||
|
subprocess.Popen(["open", "-a", "MultiMC"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
|
||||||
|
|
||||||
# mods
|
# mods
|
||||||
def mods():
|
def mods():
|
||||||
@@ -82,10 +88,7 @@ def mods():
|
|||||||
)
|
)
|
||||||
|
|
||||||
for file in glob.glob(os.path.join(INSTANCE_DIR, ".minecraft", "mods", "*")):
|
for file in glob.glob(os.path.join(INSTANCE_DIR, ".minecraft", "mods", "*")):
|
||||||
if (
|
if os.path.basename(file) in DELETION_EXEMPTED_MODS:
|
||||||
os.path.basename(file) == "OptiFine_1.16.5_HD_U_G8.jar"
|
|
||||||
or os.path.basename(file) == "TrainerCommands-1.16.5-2.6.0.jar"
|
|
||||||
):
|
|
||||||
continue
|
continue
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
|
|
||||||
|
|||||||
+11
-2
@@ -12,10 +12,19 @@ if ! [ -x "$(command -v java)" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check that multimc is installed
|
# check if is macos or linux
|
||||||
if ! [ -x "$(command -v multimc)" ]; then
|
if [[ "$OSTYPE" == "linux"* ]]; then
|
||||||
|
# check that multimc is installed
|
||||||
|
if ! [ -x "$(command -v multimc)" ]; then
|
||||||
echo 'Error: multimc is not installed. Please install it to continue.' >&2
|
echo 'Error: multimc is not installed. Please install it to continue.' >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
# check that MultiMC.app is in /Applications
|
||||||
|
if ! [ -d "/Applications/MultiMC.app" ]; then
|
||||||
|
echo 'Error: MultiMC.app is not installed. Please install it to continue.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -d .venv ]; then python -m venv .venv; fi
|
if ! [ -d .venv ]; then python -m venv .venv; fi
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# creates a desktop shortcut to run client.ps1 in powershell
|
||||||
|
|
||||||
|
$ClientFile = "$PSScriptRoot\client.ps1"
|
||||||
|
$ShortcutPath = "$Home\Desktop\FishPog Pixelmon.lnk"
|
||||||
|
$IconPath = "$PSScriptRoot\icon.ico"
|
||||||
|
|
||||||
|
$WshShell = New-Object -comObject WScript.Shell
|
||||||
|
$Shortcut = $WshShell.CreateShortcut($ShortcutPath)
|
||||||
|
$Shortcut.TargetPath = "powershell.exe"
|
||||||
|
$Shortcut.Arguments = "-ExecutionPolicy Bypass -File `"$ClientFile`""
|
||||||
|
$Shortcut.IconLocation = $IconPath
|
||||||
|
$Shortcut.Save()
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
+49
-37
@@ -3,7 +3,7 @@
|
|||||||
"version": "1.16.5",
|
"version": "1.16.5",
|
||||||
"modLoaders": [
|
"modLoaders": [
|
||||||
{
|
{
|
||||||
"id": "forge-36.2.34",
|
"id": "forge-36.2.39",
|
||||||
"primary": true
|
"primary": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -59,14 +59,6 @@
|
|||||||
"name": "Storage Drawers"
|
"name": "Storage Drawers"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"projectID": 225608,
|
|
||||||
"fileID": 3172951,
|
|
||||||
"required": true,
|
|
||||||
"__meta": {
|
|
||||||
"name": "WorldEdit"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"projectID": 228756,
|
"projectID": 228756,
|
||||||
"fileID": 3543538,
|
"fileID": 3543538,
|
||||||
@@ -151,14 +143,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"projectID": 314905,
|
"projectID": 309927,
|
||||||
"fileID": 3802698,
|
"fileID": 4419403,
|
||||||
"required": true,
|
"required": true,
|
||||||
"__meta": {
|
"__meta": {
|
||||||
"name": "FTB Ranks (Forge)",
|
"name": "Curios API (Forge)",
|
||||||
|
"explicit": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"projectID": 313536,
|
||||||
|
"fileID": 3431126,
|
||||||
|
"required": true,
|
||||||
|
"__meta": {
|
||||||
|
"name": "BountifulBaubles",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
404465,
|
309927
|
||||||
419699
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -251,18 +251,6 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"projectID": 404465,
|
|
||||||
"fileID": 3553840,
|
|
||||||
"required": true,
|
|
||||||
"__meta": {
|
|
||||||
"name": "FTB Library (Forge)",
|
|
||||||
"explicit": false,
|
|
||||||
"dependencies": [
|
|
||||||
419699
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"projectID": 410295,
|
"projectID": 410295,
|
||||||
"fileID": 4514901,
|
"fileID": 4514901,
|
||||||
@@ -272,17 +260,6 @@
|
|||||||
"explicit": false
|
"explicit": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"projectID": 410811,
|
|
||||||
"fileID": 3510643,
|
|
||||||
"required": true,
|
|
||||||
"__meta": {
|
|
||||||
"name": "FTB Essentials (Forge)",
|
|
||||||
"dependencies": [
|
|
||||||
404465
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"projectID": 419699,
|
"projectID": 419699,
|
||||||
"fileID": 4521290,
|
"fileID": 4521290,
|
||||||
@@ -292,6 +269,22 @@
|
|||||||
"explicit": false
|
"explicit": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"projectID": 422301,
|
||||||
|
"fileID": 4167327,
|
||||||
|
"required": true,
|
||||||
|
"__meta": {
|
||||||
|
"name": "Sophisticated Backpacks"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"projectID": 439870,
|
||||||
|
"fileID": 4576329,
|
||||||
|
"required": true,
|
||||||
|
"__meta": {
|
||||||
|
"name": "Customizable Player Models"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"projectID": 486392,
|
"projectID": 486392,
|
||||||
"fileID": 3535459,
|
"fileID": 3535459,
|
||||||
@@ -330,6 +323,17 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"projectID": 545905,
|
||||||
|
"fileID": 4584293,
|
||||||
|
"required": true,
|
||||||
|
"__meta": {
|
||||||
|
"name": "EnvySTS",
|
||||||
|
"dependencies": [
|
||||||
|
389487
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"projectID": 818696,
|
"projectID": 818696,
|
||||||
"fileID": 4369234,
|
"fileID": 4369234,
|
||||||
@@ -337,6 +341,14 @@
|
|||||||
"__meta": {
|
"__meta": {
|
||||||
"name": "PokeFactory Compatibility"
|
"name": "PokeFactory Compatibility"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"projectID": 861884,
|
||||||
|
"fileID": 4559794,
|
||||||
|
"required": true,
|
||||||
|
"__meta": {
|
||||||
|
"name": "Universal Pokeloot"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -29,9 +29,9 @@
|
|||||||
"uid": "net.minecraft"
|
"uid": "net.minecraft"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"cachedVersion": "36.2.34",
|
"cachedVersion": "36.2.39",
|
||||||
"uid": "net.minecraftforge",
|
"uid": "net.minecraftforge",
|
||||||
"version": "36.2.34"
|
"version": "36.2.39"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"formatVersion": 1
|
"formatVersion": 1
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+53
-20
@@ -1,28 +1,38 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import os, sys, shutil, requests, tempfile, glob, subprocess
|
import os, sys, shutil, requests, tempfile, glob, subprocess, argparse
|
||||||
from termcolor import cprint
|
from termcolor import cprint
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description="server script for FishPogPixelmon")
|
||||||
|
parser.add_argument("--plugins", "-p", help="refreshes plugins", action="store_true")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
OS = sys.platform
|
OS = sys.platform
|
||||||
|
|
||||||
|
SERVER_DIR = os.getcwd()
|
||||||
|
|
||||||
MOD_DOWNLOADER_URL = "https://github.com/Joshyx/ModpackDownloader/releases/download/v1.3/ModpackDownloader-1.3.jar"
|
MOD_DOWNLOADER_URL = "https://github.com/Joshyx/ModpackDownloader/releases/download/v1.3/ModpackDownloader-1.3.jar"
|
||||||
FORGE_URL = (
|
|
||||||
"https://maven.minecraftforge.net/net/minecraftforge/forge/1.16.5-36.2.34/forge-1.16.5-36.2.34-installer.jar"
|
|
||||||
)
|
|
||||||
FORGE_JAR = "forge-1.16.5-36.2.34.jar"
|
|
||||||
MODPACK_RELEASES_URL = "https://git.233hfd.com/api/v1/repos/joey/FishPogPixelmon/releases?limit=1"
|
MODPACK_RELEASES_URL = "https://git.233hfd.com/api/v1/repos/joey/FishPogPixelmon/releases?limit=1"
|
||||||
|
|
||||||
|
ARCLIGHT_URL = "https://github.com/IzzelAliz/Arclight/releases/download/1.16%2F1.0.24/arclight-forge-1.16.5-1.0.24.jar"
|
||||||
|
ARCLIGHT_JAR = "arclight.jar"
|
||||||
|
|
||||||
INSTANCE_DIR = os.path.join(str(os.getenv("HOME")), "pixelmon")
|
INSTANCE_DIR = os.path.join(str(os.getenv("HOME")), "pixelmon")
|
||||||
|
|
||||||
|
DELETION_EXEMPTED_MODS = ["TrainerCommands-1.16.5-2.6.0.jar"]
|
||||||
|
|
||||||
|
|
||||||
# main
|
# main
|
||||||
def __main__():
|
def __main__():
|
||||||
header()
|
header()
|
||||||
needs_mods = instance()
|
needs_mods_plugins = instance()
|
||||||
if needs_mods:
|
if needs_mods_plugins:
|
||||||
mods()
|
mods()
|
||||||
forge()
|
if args.plugins:
|
||||||
|
plugins()
|
||||||
|
arclight()
|
||||||
launch()
|
launch()
|
||||||
|
|
||||||
|
|
||||||
@@ -32,23 +42,30 @@ def launch():
|
|||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
os.chdir(f"{INSTANCE_DIR}/.minecraft")
|
os.chdir(f"{INSTANCE_DIR}/.minecraft")
|
||||||
subprocess.run(["java", "-Xmx30720M", "-Xms1024M", "-jar", FORGE_JAR, "--nogui"])
|
subprocess.run(
|
||||||
|
[
|
||||||
|
"java",
|
||||||
|
"--illegal-access=permit",
|
||||||
|
"-Xmx30720M",
|
||||||
|
"-Xms1024M",
|
||||||
|
"-jar",
|
||||||
|
ARCLIGHT_JAR,
|
||||||
|
"--nogui",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# forge
|
# arclight
|
||||||
def forge():
|
def arclight():
|
||||||
os.makedirs(f"{INSTANCE_DIR}/.minecraft", exist_ok=True)
|
os.makedirs(f"{INSTANCE_DIR}/.minecraft", exist_ok=True)
|
||||||
os.chdir(f"{INSTANCE_DIR}/.minecraft")
|
os.chdir(f"{INSTANCE_DIR}/.minecraft")
|
||||||
|
|
||||||
if os.path.exists(os.path.join(f"{INSTANCE_DIR}/.minecraft", "forge-installer.jar")):
|
if os.path.exists(os.path.join(f"{INSTANCE_DIR}/.minecraft", "arclight.jar")):
|
||||||
return
|
return
|
||||||
|
|
||||||
cprint("forge-installer.jar not found - downloading", "yellow")
|
cprint("arclight.jar not found - downloading", "yellow")
|
||||||
r = requests.get(FORGE_URL, allow_redirects=True)
|
r = requests.get(ARCLIGHT_URL, allow_redirects=True)
|
||||||
open("forge-installer.jar", "wb").write(r.content)
|
open("arclight.jar", "wb").write(r.content)
|
||||||
cprint("installing forge", "green")
|
|
||||||
|
|
||||||
subprocess.run(["java", "-jar", "forge-installer.jar", "--installServer"])
|
|
||||||
|
|
||||||
f = open("eula.txt", "w")
|
f = open("eula.txt", "w")
|
||||||
f.write("eula=true")
|
f.write("eula=true")
|
||||||
@@ -59,7 +76,7 @@ def forge():
|
|||||||
def mods():
|
def mods():
|
||||||
os.chdir(INSTANCE_DIR)
|
os.chdir(INSTANCE_DIR)
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(INSTANCE_DIR, "downloader.zip")):
|
if not os.path.exists(os.path.join(INSTANCE_DIR, "downloader.jar")):
|
||||||
cprint("downloader.jar not found - downloading", "yellow")
|
cprint("downloader.jar not found - downloading", "yellow")
|
||||||
r = requests.get(MOD_DOWNLOADER_URL, allow_redirects=True)
|
r = requests.get(MOD_DOWNLOADER_URL, allow_redirects=True)
|
||||||
open("downloader.jar", "wb").write(r.content)
|
open("downloader.jar", "wb").write(r.content)
|
||||||
@@ -73,7 +90,7 @@ def mods():
|
|||||||
subprocess.run(["java", "-jar", "downloader.jar", ".", "mods"], env=my_env)
|
subprocess.run(["java", "-jar", "downloader.jar", ".", "mods"], env=my_env)
|
||||||
|
|
||||||
for file in glob.glob(os.path.join(INSTANCE_DIR, ".minecraft", "mods", "*")):
|
for file in glob.glob(os.path.join(INSTANCE_DIR, ".minecraft", "mods", "*")):
|
||||||
if os.path.basename(file) == "TrainerCommands-1.16.5-2.6.0.jar":
|
if os.path.basename(file) in DELETION_EXEMPTED_MODS:
|
||||||
continue
|
continue
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
|
|
||||||
@@ -85,6 +102,22 @@ def mods():
|
|||||||
cprint("mods downloaded successfully", "green")
|
cprint("mods downloaded successfully", "green")
|
||||||
|
|
||||||
|
|
||||||
|
# plugins
|
||||||
|
def plugins():
|
||||||
|
os.chdir(INSTANCE_DIR)
|
||||||
|
|
||||||
|
os.makedirs(os.path.join(INSTANCE_DIR, ".minecraft", "plugins"), exist_ok=True)
|
||||||
|
|
||||||
|
for file in glob.glob(os.path.join(INSTANCE_DIR, ".minecraft", "plugins", "*")):
|
||||||
|
if file.endswith(".jar"):
|
||||||
|
os.remove(file)
|
||||||
|
|
||||||
|
for file in glob.glob(os.path.join(SERVER_DIR, "plugins", "*")):
|
||||||
|
shutil.copy(file, os.path.join(INSTANCE_DIR, ".minecraft", "plugins", os.path.basename(file)))
|
||||||
|
|
||||||
|
cprint("plugins copied successfully", "green")
|
||||||
|
|
||||||
|
|
||||||
# multimc
|
# multimc
|
||||||
def instance():
|
def instance():
|
||||||
unclean = False
|
unclean = False
|
||||||
|
|||||||
+1
-1
@@ -19,4 +19,4 @@ source .venv/bin/activate &>/dev/null
|
|||||||
python -m pip install --upgrade pip &>/dev/null
|
python -m pip install --upgrade pip &>/dev/null
|
||||||
python -m pip install -r ../client/requirements.txt &>/dev/null
|
python -m pip install -r ../client/requirements.txt &>/dev/null
|
||||||
|
|
||||||
python ./server.py
|
python ./server.py $1
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ def export_client():
|
|||||||
z.write("client/client.sh", "client.sh")
|
z.write("client/client.sh", "client.sh")
|
||||||
z.write("client/requirements.txt", "requirements.txt")
|
z.write("client/requirements.txt", "requirements.txt")
|
||||||
z.write("client/client.py", "client.py")
|
z.write("client/client.py", "client.py")
|
||||||
|
z.write("client/icon.ico", "icon.ico")
|
||||||
|
z.write("client/desktop-shortcut.ps1", "desktop-shortcut.ps1")
|
||||||
z.close()
|
z.close()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user