8 Commits

Author SHA1 Message Date
Joey Eamigh
f13458073e arclight and another client tweak 2023-06-22 17:31:51 -04:00
Joey Eamigh
315746073d desktop shortcut 2023-06-22 17:01:04 -04:00
Joey Eamigh
d9b87f40ef customizable player models mod 2023-06-22 15:12:45 -04:00
Joey Eamigh
a38910cbaf macos support 2023-06-22 13:39:56 -04:00
Joey Eamigh
93409a83f8 fixed scripts 2023-06-22 00:40:28 -04:00
Joey Eamigh
45d7fe07a5 more windows tomfoolery 2023-06-22 00:27:49 -04:00
Joey Eamigh
dac9469b37 lootr 2023-06-21 23:24:15 -04:00
Joey Eamigh
e3ae3fe83d update 2023-06-21 23:17:17 -04:00
10 changed files with 159 additions and 39 deletions

View File

@@ -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
```

View File

@@ -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 (-not (Test-Path ".venv")) { python -m venv .venv }
if (Test-Path ".venv") { } else { python -m venv .venv }
. .\.venv\Scripts\Activate.ps1 . .\.venv\Scripts\Activate.ps1

View File

@@ -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,7 +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 os.path.basename(file) == "OptiFine_1.16.5_HD_U_G8.jar": if os.path.basename(file) in DELETION_EXEMPTED_MODS:
continue continue
os.remove(file) os.remove(file)

View File

@@ -12,11 +12,20 @@ if ! [ -x "$(command -v java)" ]; then
exit 1 exit 1
fi fi
# check if is macos or linux
if [[ "$OSTYPE" == "linux"* ]]; then
# check that multimc is installed # check that multimc is installed
if ! [ -x "$(command -v multimc)" ]; then 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 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
if ! [ -d .venv ]; then python -m venv .venv; fi if ! [ -d .venv ]; then python -m venv .venv; fi

View File

@@ -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()

BIN
client/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@@ -23,6 +23,34 @@
"name": "JourneyMap" "name": "JourneyMap"
} }
}, },
{
"projectID": 55438,
"fileID": 3346467,
"required": true,
"__meta": {
"name": "MrCrayfish's Furniture Mod"
}
},
{
"projectID": 74072,
"fileID": 3695126,
"required": true,
"__meta": {
"name": "Tinkers Construct",
"dependencies": [
74924
]
}
},
{
"projectID": 74924,
"fileID": 3631982,
"required": true,
"__meta": {
"name": "Mantle",
"explicit": false
}
},
{ {
"projectID": 223852, "projectID": 223852,
"fileID": 3776277, "fileID": 3776277,
@@ -31,6 +59,14 @@
"name": "Storage Drawers" "name": "Storage Drawers"
} }
}, },
{
"projectID": 228756,
"fileID": 3543538,
"required": true,
"__meta": {
"name": "Iron Chests"
}
},
{ {
"projectID": 233342, "projectID": 233342,
"fileID": 3216206, "fileID": 3216206,
@@ -66,6 +102,14 @@
"name": "Just Enough Items (JEI)" "name": "Just Enough Items (JEI)"
} }
}, },
{
"projectID": 245755,
"fileID": 3515707,
"required": true,
"__meta": {
"name": "Waystones"
}
},
{ {
"projectID": 247560, "projectID": 247560,
"fileID": 4024011, "fileID": 4024011,
@@ -109,6 +153,14 @@
] ]
} }
}, },
{
"projectID": 361276,
"fileID": 4596216,
"required": true,
"__meta": {
"name": "Lootr (Forge)"
}
},
{ {
"projectID": 361385, "projectID": 361385,
"fileID": 3276350, "fileID": 3276350,
@@ -117,6 +169,14 @@
"name": "Pam's HarvestCraft 2 - Crops" "name": "Pam's HarvestCraft 2 - Crops"
} }
}, },
{
"projectID": 361579,
"fileID": 3767277,
"required": true,
"__meta": {
"name": "spark"
}
},
{ {
"projectID": 365460, "projectID": 365460,
"fileID": 3281234, "fileID": 3281234,
@@ -180,6 +240,23 @@
"explicit": false "explicit": false
} }
}, },
{
"projectID": 419699,
"fileID": 4521290,
"required": true,
"__meta": {
"name": "Architectury API (Fabric/Forge)",
"explicit": false
}
},
{
"projectID": 439870,
"fileID": 4576329,
"required": true,
"__meta": {
"name": "Customizable Player Models"
}
},
{ {
"projectID": 486392, "projectID": 486392,
"fileID": 3535459, "fileID": 3535459,

View File

@@ -13,8 +13,13 @@ FORGE_URL = (
FORGE_JAR = "forge-1.16.5-36.2.34.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-forge-1.16.5-1.0.24.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", "spongeforge-1.16.5-36.2.5-8.1.0-RC1352-universal.jar"]
# main # main
def __main__(): def __main__():
@@ -23,15 +28,31 @@ def __main__():
if needs_mods: if needs_mods:
mods() mods()
forge() forge()
arclight()
launch() launch()
# launcher # launcher
def launch(): def launch():
if input("launch server? [Y/n] ").lower() == "n": if input("launch server? [Y/n] ").lower() == "n":
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", "-Xmx30720M", "-Xms1024M", "-jar", ARCLIGHT_JAR, "--nogui"])
# arclight
def arclight():
os.makedirs(f"{INSTANCE_DIR}/.minecraft", exist_ok=True)
os.chdir(f"{INSTANCE_DIR}/.minecraft")
if os.path.exists(os.path.join(f"{INSTANCE_DIR}/.minecraft", "arclight.jar")):
return
cprint("arclight.jar not found - downloading", "yellow")
r = requests.get(FORGE_URL, allow_redirects=True)
open("arclight.jar", "wb").write(r.content)
# forge # forge
def forge(): def forge():
@@ -57,7 +78,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)
@@ -71,6 +92,8 @@ 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) in DELETION_EXEMPTED_MODS:
continue
os.remove(file) os.remove(file)
for file in glob.glob(os.path.join(INSTANCE_DIR, "mods", "mods", "*")): for file in glob.glob(os.path.join(INSTANCE_DIR, "mods", "mods", "*")):

View File

@@ -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()