Skip to content

Commit ffad7fa

Browse files
committed
Switch to Unimined.
Both Forges are broken in this release due to Unimined bugs. There's a PR for the problem affecting Neoforged. I'm hoping the Forge one goes away when there's no remapping.
1 parent 37a4083 commit ffad7fa

File tree

13 files changed

+101
-196
lines changed

13 files changed

+101
-196
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,6 @@ runs/
118118

119119
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
120120
!gradle-wrapper.jar
121+
122+
# Forges via Unimined
123+
accesstransformer.cfg

build.gradle

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,50 @@
11
plugins {
2-
id "architectury-plugin" version "3.4-SNAPSHOT"
3-
id 'dev.architectury.loom' version '1.13-SNAPSHOT' apply(false)
4-
}
5-
6-
architectury {
7-
minecraft = rootProject.minecraft_version
2+
id 'java'
3+
id 'xyz.wagyourtail.unimined' version '1.4.1' apply false
84
}
95

106
subprojects {
11-
apply plugin: "dev.architectury.loom"
7+
apply plugin: 'xyz.wagyourtail.unimined'
128

139
project.archivesBaseName = "${rootProject.archives_base_name}-${project.name}"
1410

15-
dependencies {
16-
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
17-
mappings loom.officialMojangMappings()
11+
configurations {
12+
modCompileOnly
13+
compileOnly.extendsFrom modCompileOnly
14+
modApi
15+
api.extendsFrom modApi
16+
}
17+
18+
unimined.minecraft(sourceSets.main, true) {
19+
version rootProject.minecraft_version
20+
21+
mappings {
22+
mojmap()
23+
devNamespace "mojmap"
24+
}
25+
26+
mods {
27+
remap(configurations.modCompileOnly) {
28+
catchAWNamespaceAssertion()
29+
}
30+
31+
remap(configurations.modApi)
32+
33+
// This is basically just a shortcut for `remap(configurations.modImplementation)`.
34+
modImplementation {
35+
// You can do this if mods have the wrong access widener mapping, but it may break runs.
36+
catchAWNamespaceAssertion()
37+
}
38+
}
1839
}
1940
}
2041

21-
// Ferry for publishing; this has to be after arch dev plugin apply and before subproject version is set.
42+
// Ferry for publishing; this has to be after unimined plugin apply and before subproject version is set.
2243
apply from: 'https://raw.githubusercontent.com/TerraformersMC/GradleScripts/3.0/ferry-mpp.gradle'
2344

2445
allprojects {
25-
apply plugin: "java"
26-
apply plugin: "architectury-plugin"
27-
apply plugin: "maven-publish"
46+
apply plugin: 'java'
47+
apply plugin: 'maven-publish'
2848

2949
group = rootProject.maven_group
3050
version = rootProject.version

common/build.gradle

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
architectury {
2-
common(rootProject.enabled_platforms.split(","))
1+
unimined.minecraft {
2+
fabric {
3+
loader fabric_loader_version
4+
accessWidener file("src/main/resources/biolith.accesswidener")
5+
}
6+
7+
defaultRemapJar = false
38
}
49

5-
loom {
6-
accessWidenerPath = file("src/main/resources/biolith.accesswidener")
10+
// Unimined hard codes injected interfaces to come from 'fabric.mod.json' in 'resources' of the 'main' source set.
11+
// This creates a frustrating situation where the main source set of :common must contain FMJ which conflicts with
12+
// the one in :fabric (and gradle's conflict resolution just arbitrarily picks "the first" version of the file)...
13+
sourceSets {
14+
withoutFMJ {
15+
java {
16+
}
17+
resources {
18+
exclude 'fabric.mod.json'
19+
}
20+
}
721
}
822

9-
dependencies {
10-
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
11-
// Do NOT use other classes from fabric loader
12-
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
13-
// Remove the next line if you don't want to depend on the API
14-
//modApi "dev.architectury:architectury:${rootProject.architectury_version}"
23+
sourcesJar {
24+
from sourceSets.withoutFMJ.allSource
25+
exclude 'fabric.mod.json'
1526
}

common/src/main/resources/architectury.common.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"schemaVersion": 1,
3+
"id": "injected_interfaces_common",
4+
"version": "1",
5+
"custom": {
6+
"loom:injected_interfaces": {
7+
"net/minecraft/class_1966": ["com/terraformersmc/biolith/impl/biome/InterfaceBiomeSource"],
8+
"net/minecraft/class_6544\u0024class_6548": ["com/terraformersmc/biolith/impl/biome/InterfaceSearchTree"]
9+
}
10+
}
11+
}

fabric/build.gradle

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,18 @@
1-
plugins {
2-
id "com.github.johnrengelman.shadow" version "7.1.2"
3-
}
4-
5-
architectury {
6-
platformSetupLoomIde()
7-
fabric()
8-
}
1+
unimined.minecraft {
2+
// Combine with common, for identifying both together as one mod for dev runs
3+
combineWith(project(":common").sourceSets.withoutFMJ)
94

10-
loom {
11-
accessWidenerPath = project(":common").loom.accessWidenerPath
12-
}
13-
14-
configurations {
15-
common
16-
shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files.
17-
compileClasspath.extendsFrom common
18-
runtimeClasspath.extendsFrom common
19-
developmentFabric.extendsFrom common
5+
fabric {
6+
loader project.fabric_loader_version
7+
accessWidener file("../common/src/main/resources/biolith.accesswidener")
8+
}
209
}
2110

2211
dependencies {
2312
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
2413
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
25-
// Remove the next line if you don't want to depend on the API
26-
//modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"
2714

28-
common(project(path: ":common", configuration: "namedElements")) { transitive = false }
29-
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive = false }
15+
implementation(project(path: ":common")) { transitive = false }
3016

3117
// Terraform Surfaces API for OpenSimplexNoise
3218
//include(modImplementation("com.terraformersmc.terraform-api:terraform-surfaces-api-v1:${rootProject.terraform_surfaces_api_version}"))
@@ -46,31 +32,13 @@ processResources {
4632
}
4733
}
4834

49-
shadowJar {
50-
exclude "architectury.common.json"
51-
52-
configurations = [project.configurations.shadowCommon]
53-
archiveClassifier.set("dev-shadow")
54-
}
55-
56-
remapJar {
57-
injectAccessWidener = true
58-
input.set shadowJar.archiveFile
59-
dependsOn shadowJar
60-
}
6135

6236
sourcesJar {
6337
def commonSources = project(":common").sourcesJar
6438
dependsOn commonSources
6539
from commonSources.archiveFile.map { zipTree(it) }
6640
}
6741

68-
components.java {
69-
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
70-
skip()
71-
}
72-
}
73-
7442
publish {
7543
onlyIf {
7644
rootProject.enabled_platforms.split(",").contains(project.projectDir)

fabric/gradle.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.

forge/build.gradle

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,20 @@
1-
plugins {
2-
id "com.github.johnrengelman.shadow" version "8.1.1"
3-
}
4-
5-
architectury {
6-
platformSetupLoomIde()
7-
forge()
8-
}
9-
10-
loom {
11-
accessWidenerPath = project(":common").loom.accessWidenerPath
12-
13-
forge {
14-
convertAccessWideners = true
15-
extraAccessWideners.add loom.accessWidenerPath.get().asFile.name
1+
unimined.minecraft {
2+
// Combine with common, for identifying both together as one mod for dev runs
3+
combineWith(project(":common").sourceSets.withoutFMJ)
164

5+
minecraftForge {
6+
loader forge_version
177
mixinConfig("biolith.mixins.json", "biolith.forge.mixins.json")
18-
}
19-
}
20-
21-
configurations {
22-
common
23-
shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files.
24-
compileClasspath.extendsFrom common
25-
runtimeClasspath.extendsFrom common
26-
developmentForge.extendsFrom common
27-
}
28-
29-
// Hack to force Forge-required version of jopt-simple (required since 1.20.5).
30-
configurations.all {
31-
resolutionStrategy {
32-
force 'net.sf.jopt-simple:jopt-simple:5.0.4'
8+
accessTransformer aw2at(file("../common/src/main/resources/biolith.accesswidener"))
339
}
3410
}
3511

3612
dependencies {
37-
forge "net.minecraftforge:forge:${rootProject.forge_version}"
38-
// Remove the next line if you don't want to depend on the API
39-
//modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}"
40-
4113
// Forge does not provide MixinExtras
4214
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:${rootProject.mixinextras_version}"))
4315
implementation(include("io.github.llamalad7:mixinextras-forge:${rootProject.mixinextras_version}"))
4416

45-
common(project(path: ":common", configuration: "namedElements")) { transitive = false }
46-
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
17+
implementation(project(path: ":common")) { transitive = false }
4718

4819
// Terraform Surfaces API for OpenSimplexNoise
4920
//include(modImplementation("com.terraformersmc.terraform-api:terraform-surfaces-api-v1:${rootProject.terraform_surfaces_api_version}"))
@@ -60,31 +31,6 @@ processResources {
6031
}
6132
}
6233

63-
shadowJar {
64-
exclude "fabric.mod.json"
65-
exclude "architectury.common.json"
66-
67-
configurations = [project.configurations.shadowCommon]
68-
archiveClassifier.set("dev-shadow")
69-
}
70-
71-
remapJar {
72-
input.set shadowJar.archiveFile
73-
dependsOn shadowJar
74-
}
75-
76-
sourcesJar {
77-
def commonSources = project(":common").sourcesJar
78-
dependsOn commonSources
79-
from commonSources.archiveFile.map { zipTree(it) }
80-
}
81-
82-
components.java {
83-
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
84-
skip()
85-
}
86-
}
87-
8834
publish {
8935
onlyIf {
9036
rootProject.enabled_platforms.split(",").contains(project.projectDir)

forge/gradle.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ fabric_api_version=0.140.0+1.21.11
1717
fabric_loader_version=0.17.3
1818

1919
# Forge
20-
forge_version=1.21.11-61.0.3
20+
forge_version=61.0.3
2121

2222
# NeoForge
23-
neoforge_version=21.11.12-beta
23+
neoforge_version=17-beta
2424

2525
##
2626
## Dependencies

0 commit comments

Comments
 (0)