Skip to content

Commit af10a46

Browse files
committed
Switch to loom in common
1 parent e6cdf38 commit af10a46

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

common/build.gradle

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@ import util.PropUtil
22

33
plugins {
44
id("multiloader-common")
5-
id("net.neoforged.moddev")
5+
id("fabric-loom")
66
}
77

88
// Configure common dependencies
99
dependencies {
10+
// Minecraft
11+
minecraft("com.mojang:minecraft:${minecraft_version}")
12+
13+
// Mappings
14+
mappings(loom.layered {
15+
officialMojangMappings()
16+
parchment("org.parchmentmc.data:parchment-${parchment_minecraft_version}:${parchment_version}@zip")
17+
})
18+
1019
// Mixin
1120
compileOnly("org.spongepowered:mixin:${mixin_version}")
1221

@@ -20,13 +29,13 @@ dependencies {
2029
return annotationProcessor(dep)
2130
break
2231
case "api": //noinspection DependencyNotationArgument
23-
return api(dep)
32+
return modApi(dep)
2433
break
2534
case "con": //noinspection DependencyNotationArgument
26-
return compileOnly(dep)
35+
return modCompileOnly(dep)
2736
break
2837
case "imp": //noinspection DependencyNotationArgument
29-
return implementation(dep)
38+
return modImplementation(dep)
3039
break
3140
case "-":
3241
return dep
@@ -38,17 +47,19 @@ dependencies {
3847
new PropUtil(project).applyDependencies(project.name, selector)
3948
}
4049

41-
// Configure ModDevGradle
42-
neoForge {
43-
neoFormVersion = neoform_version
44-
// Apply common AccessTransformer if it exists
45-
def at = file("src/main/resources/META-INF/accesstransformer.cfg")
46-
if (at.exists()) accessTransformers.from(at.absolutePath)
47-
validateAccessTransformers = true
48-
// Apply Parchment mappings
49-
parchment {
50-
minecraftVersion = parchment_minecraft_version
51-
mappingsVersion = parchment_version
50+
// Configure Loom
51+
loom {
52+
// Apply common AccessWidener if it exists
53+
def aw = project(":common").file("src/main/resources/${mod_id}.accesswidener")
54+
if (aw.exists()) accessWidenerPath.set(aw)
55+
if (aw.exists()) {
56+
validateAccessWidener { accessWidener = aw }
57+
afterEvaluate {
58+
validateAccessWidener.run()
59+
}
60+
}
61+
mixin {
62+
defaultRefmapName.set("${mod_id}.refmap.json")
5263
}
5364
}
5465

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ neoforge_deps=clothconfig,yacl
109109
# Values marked as '[x]' may be omitted if trailing, or replaced with '-' otherwise.
110110

111111
# Cloth Config https://modrinth.com/mod/9s6osm5g/versions
112-
d_common_clothconfig=-:-:imp:me.shedaniel.cloth:cloth-config-neoforge:$v
112+
d_common_clothconfig=-:-:imp:me.shedaniel.cloth:cloth-config-fabric:$v
113113
d_fabric_clothconfig=-:-:imp:me.shedaniel.cloth:cloth-config-fabric:$v:-,recommends:cloth-config,req:9s6osm5g,req:cloth-config
114114
d_neoforge_clothconfig=-:-:imp:me.shedaniel.cloth:cloth-config-neoforge:$v:-,optional:cloth-config,req:9s6osm5g,req:cloth-config
115115
v_clothconfig=19.0.147
116116
vr_fabric_clothconfig=>=19
117117
vr_neoforge_clothconfig=[19,)
118118

119119
# YACL https://modrinth.com/mod/1eAoo2KR/versions
120-
d_common_yacl=-:-:imp:dev.isxander:yet-another-config-lib:$v-neoforge:v_yacl
120+
d_common_yacl=-:-:imp:dev.isxander:yet-another-config-lib:$v-fabric:v_yacl
121121
d_fabric_yacl=-:-:imp:dev.isxander:yet-another-config-lib:$v-fabric:v_yacl,recommends:yet_another_config_lib_v3,req:1eAoo2KR,req:yacl
122122
d_neoforge_yacl=-:-:imp:dev.isxander:yet-another-config-lib:$v-neoforge:v_yacl,optional:yet_another_config_lib_v3,req:1eAoo2KR,req:yacl
123123
v_yacl=3.7.1+1.21.6

0 commit comments

Comments
 (0)