Skip to content

Commit 9cfc0e7

Browse files
committed
1.21.1/Moved to Multiloader for Fabric/NeoForge support
1 parent bababca commit 9cfc0e7

File tree

503 files changed

+9636
-9268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

503 files changed

+9636
-9268
lines changed

.gitignore

+28-30
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
1-
# gradle
2-
3-
.gradle/
4-
build/
5-
out/
6-
classes/
7-
81
# eclipse
9-
2+
bin
103
*.launch
4+
.settings
5+
.metadata
6+
.classpath
7+
.project
8+
mcmodsrepo
119

1210
# idea
13-
14-
.idea/
15-
*.iml
11+
out
1612
*.ipr
1713
*.iws
18-
19-
# vscode
20-
21-
.settings/
22-
.vscode/
23-
bin/
24-
.classpath
25-
.project
26-
27-
# macos
28-
29-
*.DS_Store
30-
31-
# fabric
32-
33-
run/
34-
.github/workflows/build.yml
14+
*.iml
15+
.idea
16+
caches
17+
daemon
18+
wrapper
19+
native
20+
21+
# allow gradlew
22+
!gradle/wrapper
23+
# gradle
24+
build
25+
.gradle
26+
logs
27+
# other
28+
eclipse
29+
run
30+
runClient
31+
runs
32+
33+
# Files from Forge MDK
34+
forge*changelog.txt
3535
build.bat
36-
update_mappings.bat
37-
*.bat

build.gradle

+3-143
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,4 @@
11
plugins {
2-
id 'fabric-loom' version '1.6-SNAPSHOT'
3-
id 'maven-publish'
4-
id "me.modmuss50.mod-publish-plugin" version "0.4.0"
5-
}
6-
7-
import groovy.json.JsonOutput
8-
import groovy.json.JsonSlurper
9-
10-
sourceCompatibility = JavaVersion.VERSION_21
11-
targetCompatibility = JavaVersion.VERSION_21
12-
13-
archivesBaseName = project.modName
14-
version = project.modVersion
15-
group = project.mavenGroup
16-
17-
repositories {
18-
maven { url "https://cfa2.cursemaven.com" }
19-
maven { url "https://maven.shedaniel.me/" }
20-
maven { url "https://maven.terraformersmc.com/" }
21-
maven { url "https://libs.azuredoom.com:4443/mods" }
22-
maven { url "https://dl.cloudsmith.io/public/tslat/sbl/maven/" }
23-
maven { url "https://plugins.gradle.org/m2/" }
24-
maven { url "https://api.modrinth.com/maven" }
25-
maven { url 'https://maven.parchmentmc.org' }
26-
maven { url 'https://jm.gserv.me/repository/maven-public/' }
27-
}
28-
29-
dependencies {
30-
minecraft "com.mojang:minecraft:${project.minecraftVersion}"
31-
mappings loom.layered() {
32-
officialMojangMappings()
33-
parchment("org.parchmentmc.data:parchment-1.20.6:2024.06.02@zip")
34-
}
35-
modImplementation "net.fabricmc:fabric-loader:${project.loaderVersion}"
36-
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabricVersion}"
37-
modImplementation "mod.azure.azurelib:azurelib-fabric-${project.minecraftVersion}:${project.azurelibVersion}"
38-
modImplementation "com.terraformersmc:modmenu:${project.modmenuVersion}"
39-
modImplementation "maven.modrinth:smartbrainlib:mY9xu8va"
40-
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.reiVersion}"
41-
modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.reiVersion}"
42-
modApi "dev.architectury:architectury-fabric:${project.archVersion}"
43-
modApi "me.shedaniel.cloth:cloth-config-fabric:${project.clothVersion}"
44-
include(modImplementation "maven.modrinth:common-network:1.0.10-1.20.6")
45-
}
46-
47-
processResources {
48-
inputs.property "version", project.version
49-
50-
filesMatching("fabric.mod.json") {
51-
expand "version": project.version
52-
}
53-
54-
doLast {
55-
def jsonMinifyStart = System.currentTimeMillis()
56-
def jsonMinified = 0
57-
def jsonBytesSaved = 0
58-
fileTree(dir: outputs.files.asPath, include: '**/*.json').each {
59-
File file = it
60-
jsonMinified++
61-
def oldLength = file.length()
62-
file.text = JsonOutput.toJson(new JsonSlurper().parse(file))
63-
jsonBytesSaved += oldLength - file.length()
64-
}
65-
println('Minified ' + jsonMinified + ' json files. Saved ' + jsonBytesSaved + ' bytes. Took ' + (System.currentTimeMillis() - jsonMinifyStart) + 'ms.')
66-
}
67-
}
68-
69-
tasks.withType(JavaCompile).configureEach {
70-
it.options.release = 21
71-
}
72-
73-
jar {
74-
from "LICENSE"
75-
}
76-
77-
loom {
78-
accessWidenerPath = file("src/main/resources/hwg.accesswidener")
79-
80-
runs {
81-
// This adds a new gradle task that runs the datagen API: "gradlew runDatagen"
82-
datagen {
83-
inherit server
84-
name "Minecraft Datagen"
85-
vmArg "-Dfabric-api.datagen"
86-
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}"
87-
vmArg "-Dfabric-api.datagen.modid=hwg"
88-
89-
runDir "build/datagen"
90-
}
91-
}
92-
}
93-
94-
if (file('key.properties').exists()) {
95-
publishMods {
96-
def releaseProp = new Properties()
97-
File secretPropsFile = file("key.properties")
98-
releaseProp.load(secretPropsFile.newInputStream())
99-
file = remapJar.archiveFile
100-
changelog = rootProject.file("changelog.md").text
101-
type = STABLE
102-
modLoaders.add("fabric")
103-
104-
curseforge {
105-
projectId = project.curseforgeID
106-
projectSlug = project.projectSlug
107-
accessToken = releaseProp.getProperty("curseKey")
108-
minecraftVersions.add("${minecraftVersion}")
109-
requires {
110-
slug = "fabric-api"
111-
}
112-
requires {
113-
slug = "azurelib"
114-
}
115-
requires {
116-
slug = "smartbrainlib"
117-
}
118-
}
119-
modrinth {
120-
projectId = project.modrinthID
121-
accessToken = releaseProp.getProperty('modrinthKey')
122-
minecraftVersions.add("${minecraftVersion}")
123-
requires {
124-
slug = "fabric-api"
125-
}
126-
requires {
127-
slug = "azurelib"
128-
}
129-
requires {
130-
slug = "smartbrainlib"
131-
}
132-
}
133-
}
134-
}
135-
136-
sourceSets {
137-
main {
138-
resources {
139-
srcDirs += [
140-
'src/main/generated'
141-
]
142-
}
143-
}
144-
}
2+
// Required for NeoGradle
3+
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
4+
}

buildSrc/build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id 'groovy-gradle-plugin'
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
plugins {
2+
id 'java-library'
3+
id 'maven-publish'
4+
id 'idea'
5+
}
6+
7+
base {
8+
archivesName = "${mod_id}-${project.name}-${minecraft_version}"
9+
}
10+
11+
java {
12+
toolchain.languageVersion = JavaLanguageVersion.of(java_version)
13+
withSourcesJar()
14+
withJavadocJar()
15+
}
16+
17+
repositories {
18+
mavenCentral()
19+
// https://docs.gradle.org/current/userguide/declaring_repositories.html#declaring_content_exclusively_found_in_one_repository
20+
exclusiveContent {
21+
forRepository {
22+
maven {
23+
name = 'Sponge'
24+
url = 'https://repo.spongepowered.org/repository/maven-public'
25+
}
26+
}
27+
filter { includeGroupAndSubgroups("org.spongepowered") }
28+
}
29+
maven {
30+
name = 'BlameJared'
31+
url = 'https://maven.blamejared.com'
32+
}
33+
maven { url "https://maven.terraformersmc.com/" }
34+
maven { url "https://maven.terraformersmc.com/releases" } // modmenu
35+
maven { url 'https://libs.azuredoom.com:4443/mods' }
36+
maven {
37+
name = 'Parchment'
38+
url = 'https://maven.parchmentmc.org'
39+
}
40+
maven { url "https://maven.shedaniel.me" }
41+
maven { url 'https://api.modrinth.com/maven' }
42+
maven { url "https://jm.gserv.me/repository/maven-public/" }
43+
maven { url "https://maven.terraformersmc.com/" }
44+
maven { url "https://maven.terraformersmc.com/releases" } // modmenu
45+
maven { url 'https://maven.kosmx.dev/' }
46+
maven { url 'https://jitpack.io' }
47+
}
48+
49+
dependencies {
50+
implementation 'org.jetbrains:annotations:24.1.0'
51+
}
52+
53+
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
54+
configurations."$variant".outgoing {
55+
capability("$group:$mod_id-${project.name}-${minecraft_version}:$version")
56+
capability("$group:$mod_id:$version")
57+
}
58+
publishing.publications.configureEach {
59+
suppressPomMetadataWarningsFor(variant)
60+
}
61+
}
62+
63+
sourcesJar {
64+
from(rootProject.file("LICENSE")) {
65+
rename { "${it}_${mod_name}" }
66+
}
67+
}
68+
69+
jar {
70+
from(rootProject.file("LICENSE")) {
71+
rename { "${it}_${mod_name}" }
72+
}
73+
74+
manifest {
75+
attributes([
76+
'Specification-Title' : mod_name,
77+
'Specification-Vendor' : mod_author,
78+
'Specification-Version' : project.jar.archiveVersion,
79+
'Implementation-Title' : project.name,
80+
'Implementation-Version': project.jar.archiveVersion,
81+
'Implementation-Vendor' : mod_author,
82+
'Built-On-Minecraft' : minecraft_version
83+
])
84+
}
85+
}
86+
87+
processResources {
88+
def expandProps = [
89+
"version": version,
90+
"group": project.group,
91+
"minecraft_version": minecraft_version,
92+
"minecraft_version_range": minecraft_version_range,
93+
"fabric_version": fabric_version,
94+
"fabric_loader_version": fabric_loader_version,
95+
"mod_name": mod_name,
96+
"mod_author": mod_author,
97+
"mod_id": mod_id,
98+
"mod_logo": mod_logo,
99+
"mod_license": mod_license,
100+
"mod_description": mod_description,
101+
"mod_issues": mod_issues,
102+
"mod_sources": mod_sources,
103+
"mod_url": mod_url,
104+
"loader_version_range": loader_version_range,
105+
"neo_version": neo_version,
106+
"neo_version_range": neo_version_range,
107+
"mod_credits": mod_credits,
108+
"java_version": java_version,
109+
"azurelib_version": azurelib_version
110+
]
111+
112+
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'META-INF/neoforge.mods.toml', '*.mixins.json']) {
113+
expand expandProps
114+
}
115+
inputs.properties(expandProps)
116+
}
117+
118+
idea {
119+
module {
120+
downloadSources = true
121+
downloadJavadoc = true
122+
}
123+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
plugins {
2+
id 'multiloader-common'
3+
}
4+
5+
configurations {
6+
commonJava{
7+
canBeResolved = true
8+
}
9+
commonResources{
10+
canBeResolved = true
11+
}
12+
}
13+
14+
dependencies {
15+
compileOnly(project(':common')) {
16+
capabilities {
17+
requireCapability "$group:$mod_id"
18+
}
19+
}
20+
commonJava project(path: ':common', configuration: 'commonJava')
21+
commonResources project(path: ':common', configuration: 'commonResources')
22+
}
23+
24+
tasks.named('compileJava', JavaCompile) {
25+
dependsOn(configurations.commonJava)
26+
source(configurations.commonJava)
27+
}
28+
29+
processResources {
30+
dependsOn(configurations.commonResources)
31+
from(configurations.commonResources)
32+
}
33+
34+
tasks.named('javadoc', Javadoc).configure {
35+
dependsOn(configurations.commonJava)
36+
source(configurations.commonJava)
37+
}
38+
39+
tasks.named("sourcesJar", Jar) {
40+
dependsOn(configurations.commonJava)
41+
from(configurations.commonJava)
42+
dependsOn(configurations.commonResources)
43+
from(configurations.commonResources)
44+
}

changelog.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
v.2.2.0
1+
v1.0.0
22

3-
- Ported to 1.20.6

0 commit comments

Comments
 (0)