Skip to content

Commit f4122a9

Browse files
committed
Use loom in common
1 parent cabd252 commit f4122a9

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

common/build.gradle

Lines changed: 23 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,16 @@ 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 = 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+
}
5260
}
5361
}
5462

gradle.properties

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

111111
# YACL https://modrinth.com/project/1eAoo2KR/versions
112-
d_common_yacl=-:-:imp:dev.isxander:yet-another-config-lib:$v-neoforge:v_yacl
112+
d_common_yacl=-:-:imp:dev.isxander:yet-another-config-lib:$v-fabric:v_yacl
113113
d_fabric_yacl=-:-:imp:dev.isxander:yet-another-config-lib:$v-fabric:v_yacl,recommends:yet_another_config_lib_v3,req:1eAoo2KR,req:yacl
114114
d_neoforge_yacl=-:-:imp:dev.isxander:yet-another-config-lib:$v-neoforge:v_yacl,optional:yet_another_config_lib_v3,req:1eAoo2KR,req:yacl
115115
v_yacl=3.7.1+1.21.6

0 commit comments

Comments
 (0)