@@ -11,43 +11,44 @@ plugins {
1111}
1212
1313class ModData {
14- val id = property(" mod.id" ).toString()
15- val name = property(" mod.name" )
16- val version = property(" mod.version" )
17- val group = property(" mod.group" ).toString()
18- val description = property(" mod.description" )
19- val source = property(" mod.source" )
20- val issues = property(" mod.issues" )
21- val license = property(" mod.license" ).toString()
22- val modrinth = property(" mod.modrinth" )
23- val curseforge = property(" mod.curseforge" )
24- val discord = property(" mod.discord" )
25- val obfuscated = parseBoolean(property(" mod.obfuscated" ).toString() )
14+ val id = property(" mod.id" ) as String
15+ val name = property(" mod.name" ) as String
16+ val version = property(" mod.version" ) as String
17+ val group = property(" mod.group" ) as String
18+ val description = property(" mod.description" ) as String
19+ val source = property(" mod.source" ) as String
20+ val issues = property(" mod.issues" ) as String
21+ val license = property(" mod.license" ) as String
22+ val modrinth = property(" mod.modrinth" ) as String
23+ val curseforge = property(" mod.curseforge" ) as String
24+ val discord = property(" mod.discord" ) as String
25+ val obfuscated = parseBoolean(property(" mod.obfuscated" ) as String )
2626 val minecraftVersion = property(" mod.minecraft_version" ) as String
2727 val minecraftVersionRange = property(" mod.minecraft_version_range" ) as String
2828}
2929
3030class Dependencies {
31- val neoForgeVersion = property(" deps.neoforge_version" )
32- val fabricLoaderVersion = property(" deps.fabric_loader_version" )
33- val fabricApiVersion = property(" deps.fabric_api_version" ).toString()
34- val mixinconstraintsVersion = property(" deps.mixinconstraints_version" )
35- val mixinsquaredVersion = property(" deps.mixinsquared_version" )
36- val lombokVersion = property(" deps.lombok_version" )
37- val lightConfigVersion = property(" deps.lightconfig_version" )
31+ val neoForgeVersion = property(" deps.neoforge_version" ) as String?
32+ val fabricLoaderVersion = property(" deps.fabric_loader_version" ) as String?
33+ val fabricApiVersion = property(" deps.fabric_api_version" ) as String?
34+ val devAuthVersion = property(" deps.devauth_version" ) as String?
35+ val mixinconstraintsVersion = property(" deps.mixinconstraints_version" ) as String?
36+ val mixinsquaredVersion = property(" deps.mixinsquared_version" ) as String?
37+ val lombokVersion = property(" deps.lombok_version" ) as String?
38+ val lightConfigVersion = property(" deps.lightconfig_version" ) as String?
3839}
3940
4041class LoaderData {
41- val loader = loom.platform.get().name.lowercase()
42- val isFabric = loader == " fabric"
43- val isNeoforge = loader == " neoforge"
42+ val name = loom.platform.get().name.lowercase()
43+ val isFabric = this @LoaderData.name == " fabric"
44+ val isNeoforge = this @LoaderData.name == " neoforge"
4445}
4546
4647val mod = ModData ()
4748val deps = Dependencies ()
4849val loader = LoaderData ()
4950
50- version = " ${mod.version} +${mod.minecraftVersion} -${loader.loader } "
51+ version = " ${mod.version} +${mod.minecraftVersion} -${loader.name } "
5152group = mod.group
5253base { archivesName.set(mod.id) }
5354
@@ -84,6 +85,8 @@ loom.runs {
8485 vmArg(" -javaagent:$mixinJarFile " ) // Mixin Hotswap doesn't work on NeoForge, but doesn't hurt to keep
8586 property(" mixin.hotSwap" , " true" )
8687 property(" mixin.debug.export" , " true" ) // Puts mixin outputs in /run/.mixin.out
88+ property(" devauth.enabled" , " true" )
89+ property(" devauth.account" , " main" )
8790 }
8891 }
8992}
@@ -100,13 +103,14 @@ fletchingTable {
100103
101104repositories {
102105 mavenCentral()
106+ mavenLocal()
103107 maven(" https://maven.parchmentmc.org" ) // Parchment
104- maven(" https://maven.terraformersmc.com" ) // Mod Menu
105108 maven(" https://maven.nucleoid.xyz/" ) // Placeholder API - required by Mod Menu
109+ maven(" https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1" ) // DevAuth
106110 maven(" https://maven.neoforged.net/releases" ) // NeoForge
107111 maven(" https://maven.bawnorton.com/releases" ) // MixinSquared
112+ maven(" https://maven.terraformersmc.com" ) // Mod Menu
108113 maven(" https://api.modrinth.com/maven" ) // Modrinth
109- maven(" https://jitpack.io" ) // LightConfig
110114}
111115
112116dependencies {
@@ -124,20 +128,23 @@ dependencies {
124128
125129 compileOnly(" org.projectlombok:lombok:${deps.lombokVersion} " )
126130 annotationProcessor(" org.projectlombok:lombok:${deps.lombokVersion} " )
131+ modRuntimeOnly(" me.djtheredstoner:DevAuth-${loader.name} :${deps.devAuthVersion} " )
127132
128133 // LightConfig
129- include(modImplementation(" com.github.Legacy-Visuals-Project:LightConfig :${deps.lightConfigVersion} " )!! )
134+ include(modImplementation(" org.visuals.legacy:lightconfig :${deps.lightConfigVersion} - ${mod.minecraftVersion} _ ${loader.name }" )!! )
130135
131136 include(implementation(" com.moulberry:mixinconstraints:${deps.mixinconstraintsVersion} " )!! )!!
132- include(implementation(annotationProcessor(" com.github.bawnorton.mixinsquared:mixinsquared-${loader.loader } :${deps.mixinsquaredVersion} " )!! )!! )
137+ include(implementation(annotationProcessor(" com.github.bawnorton.mixinsquared:mixinsquared-${loader.name } :${deps.mixinsquaredVersion} " )!! )!! )
133138 if (loader.isFabric) {
134139 modImplementation(" net.fabricmc:fabric-loader:${deps.fabricLoaderVersion} " )
135140
136141 modImplementation(fabricApi.module(" fabric-resource-loader-v0" , deps.fabricApiVersion))
137142 modImplementation(fabricApi.module(" fabric-command-api-v2" , deps.fabricApiVersion))
138143
139144 optionalProp(" deps.modmenu_version" ) { prop ->
140- modImplementation(" com.terraformersmc:modmenu:${prop} " )
145+ modImplementation(" com.terraformersmc:modmenu:${prop} " ) {
146+ exclude(group, " net.fabricmc.fabric-api" )
147+ }
141148 }
142149 } else if (loader.isNeoforge) {
143150 " neoForge" (" net.neoforged:neoforge:${deps.neoForgeVersion} " )
@@ -166,7 +173,7 @@ publishMods {
166173 changelog = project.rootProject.file(" CHANGELOG.md" ).takeIf { it.exists() }?.readText() ? : " No changelog provided."
167174 type = STABLE
168175
169- modLoaders.add(loader.loader )
176+ modLoaders.add(loader.name )
170177 dryRun = modrinthId == null && curseforgeId == null
171178 if (modrinthId != null ) {
172179 modrinth {
@@ -213,6 +220,11 @@ tasks {
213220 put(" discord" , mod.discord)
214221 if (loader.isFabric) {
215222 put(" fabric_loader_version" , deps.fabricLoaderVersion)
223+ put(" fabric_resource_loader_dep" , if (stonecutter.eval(stonecutter.current.version, " >=1.21.10" ))
224+ " fabric-resource-loader-v1"
225+ else
226+ " fabric-resource-loader-v0"
227+ )
216228 }
217229
218230 if (loader.isNeoforge) {
0 commit comments