Add Neoforge and upgrade template

Forge is not working but I can't really do anything about it
This commit is contained in:
axolotlmaid 2024-06-02 17:27:15 +01:00
parent f0cebb6252
commit 2690515316
20 changed files with 227 additions and 212 deletions

View file

@ -1,5 +1,11 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id 'com.github.johnrengelman.shadow'
}
loom {
forge {
mixinConfig "optionsprofiles.mixins.json"
}
}
architectury {
@ -7,84 +13,47 @@ architectury {
forge()
}
loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
forge {
convertAccessWideners = true
extraAccessWideners.add loom.accessWidenerPath.get().asFile.name
mixinConfig "optionsprofiles-common.mixins.json"
mixinConfig "optionsprofiles.mixins.json"
}
mods {
register("forge") {
sourceSet("main", project(":forge"))
}
}
}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files.
common {
canBeResolved = true
canBeConsumed = false
}
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentForge.extendsFrom common
// Files in this configuration will be bundled into your mod using the Shadow plugin.
// Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files.
shadowBundle {
canBeResolved = true
canBeConsumed = false
}
}
configurations.all {
resolutionStrategy.force("net.sf.jopt-simple:jopt-simple:5.0.4")
}
dependencies {
forge "net.minecraftforge:forge:${rootProject.forge_version}"
// Remove the next line if you don't want to depend on the API
// modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}"
forge "net.minecraftforge:forge:$rootProject.forge_version"
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
common(project(path: ':common', configuration: 'namedElements')) { transitive false }
shadowBundle project(path: ':common', configuration: 'transformProductionForge')
}
processResources {
inputs.property "version", project.version
inputs.property 'version', project.version
filesMatching("META-INF/mods.toml") {
expand "version": project.version
filesMatching('META-INF/mods.toml') {
expand version: project.version
}
}
shadowJar {
exclude "fabric.mod.json"
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
archiveClassifier = "dev-shadow"
configurations = [project.configurations.shadowBundle]
archiveClassifier = 'dev-shadow'
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
publishing {
publications {
mavenForge(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
}
}

View file

@ -1 +1 @@
loom.platform=forge
loom.platform = forge

View file

@ -1,5 +1,5 @@
modLoader = "javafml"
loaderVersion = "[49,)"
loaderVersion = "[50,)"
#issueTrackerURL = ""
license = "GNU GPL 3.0"
@ -16,13 +16,13 @@ logoFile = "icon.png"
[[dependencies.optionsprofiles]]
modId = "forge"
mandatory = true
versionRange = "[49,)"
versionRange = "[50,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.optionsprofiles]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20.4,)"
versionRange = "[1.20.6,)"
ordering = "NONE"
side = "BOTH"

View file

@ -1,13 +0,0 @@
{
"required": true,
"package": "com.axolotlmaid.optionsprofiles.mixin.forge",
"compatibilityLevel": "JAVA_17",
"minVersion": "0.8",
"client": [
],
"mixins": [
],
"injectors": {
"defaultRequire": 1
}
}

View file

@ -1,6 +1,6 @@
{
"pack": {
"description": "Options Profiles",
"pack_format": 15
"pack_format": 22
}
}