Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
chore: Add modloader name to the jar file
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Nov 7, 2023
1 parent 5af240b commit f8a8635
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ def _env = System.getenv()

archivesBaseName = project.archives_base_name

def buildNumber = _env["GITHUB_RUN_NUMBER"]
version = project.mod_version + (buildNumber != null ? "b${buildNumber}" : "") + "-BETA"
group = project.maven_group

// TODO: For later
def isForge = project.name.endsWith("forge")
def isNeo = project.name.endsWith("neoforge")
def isFabric = project.name.endsWith("fabric")

def buildNumber = _env["GITHUB_RUN_NUMBER"]
version = project.mod_version + (buildNumber != null ? "b${buildNumber}" : "") + "-BETA" + (isFabric ? "-fabric" : "-forge")
group = project.maven_group

def mcVersion
def (major, minor, patch) = project.name.tokenize('-')[0].tokenize('.')
mcVersion = "${major}${minor.padLeft(2, '0')}${(patch ?: '').padLeft(2, '0')}" as int
Expand Down Expand Up @@ -98,6 +97,7 @@ remapJar {
tasks.processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE

def metadataVersion = project.mod_version + (buildNumber != null ? "b${buildNumber}" : "") + "-BETA"
def metadataMCVersion =
supportedVersionRange[0] != null ? (
(isFabric ? ">=" : "[") +
Expand All @@ -106,12 +106,12 @@ tasks.processResources {
? (isFabric ? "" : ",)")
: ((isFabric ? " <=" : ",") + supportedVersionRange[1] + (isFabric ? "" : "]")))
) : (isFabric ? supportedVersionRange[1] : "[${supportedVersionRange[1]}]")
inputs.property "version", project.version
inputs.property "version", metadataVersion
inputs.property "mcversion", metadataMCVersion
filteringCharset "UTF-8"

filesMatching(isFabric ? "fabric.mod.json" : "META-INF/mods.toml") {
expand "version": project.version, "mcversion": metadataMCVersion
expand "version": metadataVersion, "mcversion": metadataMCVersion
}
}

Expand Down

0 comments on commit f8a8635

Please sign in to comment.