Skip to content

Commit

Permalink
Merge pull request #4 from tildejustin/upstream
Browse files Browse the repository at this point in the history
add pre 1.6 username and session token patch (huge thanks to AdelinaM17n for finding this!)
  • Loading branch information
BluCobalt authored Oct 28, 2023
2 parents fbf673d + 4d9a615 commit 9cf12bd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
26 changes: 15 additions & 11 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import zipfile

loader: str = "0.14.22"
loader: str = "0.14.24"
legacy_fixes: str = "legacy-fixes-1.0.1.jar"
lwjgl3: str = "3.1.6"
lwjgl2: str = "2.9.4-nightly-20150209"
Expand Down Expand Up @@ -54,20 +54,24 @@ def prepare_skeleton(self):
with open("temp/patches/org.lwjgl.lwjgl.json", "w") as t:
t.write(self.process(f.read()))

if self.minecraft_version == "1.6.4" or "1.5.2" or "1.4.7" or "1.3.2":
with open("skel/patches/net.fabricmc.intermediary.pre-1.7.json", "r") as f:
with open("temp/patches/net.fabricmc.intermediary.json", "w") as t:
t.write(self.process(f.read()))
else:
with open("skel/patches/net.fabricmc.intermediary.json", "r") as f:
with open("temp/patches/net.fabricmc.intermediary.json", "w") as t:
t.write(self.process(f.read()))
intermediary_patch: str
match self.minecraft_version:
case "1.6.4":
intermediary_patch = "skel/patches/net.fabricmc.intermediary.pre-1.7.json"
case "1.5.2" | "1.4.7" | "1.3.2":
intermediary_patch = "skel/patches/net.fabricmc.intermediary.pre-1.6.json"
case _:
intermediary_patch = "skel/patches/net.fabricmc.intermediary.json"

with open(intermediary_patch, "r") as f:
with open("temp/patches/net.fabricmc.intermediary.json", "w") as t:
t.write(self.process(f.read()))

with open("skel/legacyfabric.png", "rb") as f:
with open("temp/legacyfabric.png", "wb") as t:
t.write(f.read())

if self.minecraft_version == "1.8.9" or self.minecraft_version == "1.7.10" or self.minecraft_version == "1.6.4" or self.minecraft_version == "1.5.2" or self.minecraft_version == "1.4.7" or self.minecraft_version == "1.3.2":
if self.minecraft_version in ("1.8.9", "1.7.10", "1.6.4", "1.5.2", "1.4.7", "1.3.2"):
mkdir_if_not_exists("temp/.minecraft")
mkdir_if_not_exists("temp/.minecraft/mods")
with open(f"skel/.minecraft/mods/{legacy_fixes}", "rb") as f:
Expand All @@ -86,7 +90,7 @@ def create_zip(self):
z.write("temp/patches/org.lwjgl.lwjgl.json",
"patches/org.lwjgl.json")

if self.minecraft_version == "1.8.9" or self.minecraft_version == "1.7.10" or self.minecraft_version == "1.6.4" or self.minecraft_version == "1.5.2" or self.minecraft_version == "1.4.7" or self.minecraft_version == "1.3.2":
if self.minecraft_version in ("1.8.9", "1.7.10", "1.6.4", "1.5.2", "1.4.7", "1.3.2"):
z.write(f"temp/.minecraft/mods/{legacy_fixes}", f".minecraft/mods/{legacy_fixes}")

self.cleanup()
Expand Down
16 changes: 16 additions & 0 deletions skel/patches/net.fabricmc.intermediary.pre-1.6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"formatVersion": 1,
"+libraries": [
{
"name": "net.legacyfabric:intermediary:${minecraft_version}",
"url": "https://maven.legacyfabric.net/"
}
],
"+traits": [
"noapplet"
],
"minecraftArguments": "${auth_player_name} ${auth_session} --gameDir ${game_directory} --assetsDir ${game_assets}",
"name": "Intermediary Mappings",
"uid": "net.fabricmc.intermediary",
"version": "${minecraft_version}"
}

0 comments on commit 9cf12bd

Please sign in to comment.