fix: use new neoforge artifact in library names

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2023-11-01 11:03:31 +01:00
parent 0baa8da375
commit 8e47317406
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951
2 changed files with 8 additions and 4 deletions

View File

@ -60,7 +60,7 @@ def version_from_build_system_installer(
)
installer_lib = Library(
name=GradleSpecifier(
"net.neoforged", "forge", version.long_version, "installer"
"net.neoforged", version.artifact, version.long_version, "installer"
)
)
installer_lib.downloads = MojangLibraryDownloads()
@ -78,9 +78,12 @@ def version_from_build_system_installer(
if (
forge_lib.name.group == "net.neoforged"
and forge_lib.name.artifact == "forge"
and forge_lib.name.artifact == version.artifact
and forge_lib.name.classifier == "universal"
):
# WORKAROUND: Early NeoForge 20.2 versions have an invalid version for universal jars. Instead of 1.20.2-20.2.20-beta it should just be 20.2.20-beta
if version.artifact == "neoforge":
forge_lib.name.version = version.long_version
forge_lib.downloads.artifact.url = (
"https://maven.neoforged.net/%s" % forge_lib.name.path()
)
@ -96,7 +99,7 @@ def version_from_build_system_installer(
continue
if forge_lib.name.group == "net.neoforged":
if forge_lib.name.artifact == "forge":
if forge_lib.name.artifact == version.artifact:
forge_lib.name.classifier = "launcher"
forge_lib.downloads.artifact.path = forge_lib.name.path()
forge_lib.downloads.artifact.url = (

View File

@ -180,9 +180,10 @@ class InstallerInfo(MetaBase):
# A post-processed entry constructed from the reconstructed NeoForge version index
class NeoForgeVersion:
def __init__(self, entry: NeoForgeEntry):
self.artifact = entry.artifact
self.build = entry.build
self.rawVersion = entry.version
if entry.artifact == "neoforge":
if self.artifact == "neoforge":
self.rawVersion = entry.long_version
self.mc_version = entry.mc_version