Skip to content

Commit 4cc3995

Browse files
committed
Port to MC 1.20
1 parent 90b0398 commit 4cc3995

39 files changed

+1249
-296
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ build
2020
# other
2121
eclipse
2222
run
23+
*.DS_Store

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pipeline {
3131
]) {
3232

3333
echo 'Building project.'
34-
sh './gradlew build publish publishCurseForge updateVersionTracker postDiscord --stacktrace --warn'
34+
sh './gradlew build publish publishCurseForge modrinth updateVersionTracker postDiscord --stacktrace --warn'
3535
}
3636
}
3737
}

build.gradle

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22
buildscript {
33

44
repositories {
5-
5+
66
mavenCentral()
77
}
8-
8+
99
dependencies {
10-
10+
1111
classpath group: 'com.diluv.schoomp', name: 'Schoomp', version: '1.2.5'
1212
}
1313
}
1414

15+
plugins {
16+
id 'fabric-loom' version '1.2-SNAPSHOT' apply(false)
17+
id 'net.minecraftforge.gradle' version '[6.0,6.2)' apply(false)
18+
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' apply(false)
19+
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' apply(false)
20+
id 'net.darkhax.curseforgegradle' version '1.1.15' apply(false)
21+
id 'com.modrinth.minotaur' version '2.8.0' apply(false)
22+
}
23+
1524
apply from: 'gradle/property_loader.gradle'
1625
apply from: 'gradle/build_number.gradle'
1726
apply from: 'gradle/git_changelog.gradle'
@@ -20,28 +29,29 @@ apply from: 'gradle/version_checker.gradle'
2029
subprojects {
2130

2231
apply plugin: 'maven-publish'
23-
32+
2433
apply from: '../gradle/property_loader.gradle'
2534
apply from: '../gradle/java.gradle'
2635
apply from: '../gradle/build_number.gradle'
2736
apply from: '../gradle/git_changelog.gradle'
2837
apply from: '../gradle/minify_jsons.gradle'
2938
apply from: '../gradle/signing.gradle'
30-
39+
3140
// Disables Gradle's custom module metadata from being published to maven. The
3241
// metadata includes mapped dependencies which are not reasonably consumable by
3342
// other mod developers.
3443
tasks.withType(GenerateModuleMetadata) {
3544

3645
enabled = false
3746
}
38-
47+
3948
// Enable Mixins
4049
project.ext.mixin_enabled = project.file("src/main/resources/${mod_id}.mixins.json").exists()
4150
project.logger.lifecycle("Mixin ${project.ext.mixin_enabled ? 'enabled' : 'disabled'} for project ${project.name}.")
42-
51+
4352
repositories {
4453

54+
mavenLocal()
4555
mavenCentral()
4656

4757
maven {
@@ -53,11 +63,16 @@ subprojects {
5363
name = 'BlameJared Maven (CrT / Bookshelf)'
5464
url = 'https://maven.blamejared.com'
5565
}
56-
66+
5767
maven {
5868
name = 'Mod Menu'
5969
url = 'https://maven.terraformersmc.com/releases/'
6070
}
71+
72+
maven {
73+
name = 'JitPack'
74+
url = 'https://jitpack.io'
75+
}
6176
}
6277
}
6378

@@ -73,47 +88,47 @@ task postDiscord() {
7388

7489
// Create a new webhook instance for Discord
7590
def webhook = new Webhook(findProperty('curse_discord_webhook'), "${project.ext.mod_name} CurseForge Gradle Upload")
76-
91+
7792
// Craft a message to send to Discord using the webhook.
78-
def message = new Message()
93+
def message = new Message()
7994
message.setUsername("Mod Update: ${project.ext.mod_name}")
8095
message.setContent("${project.ext.mod_name} ${project.version} for Minecraft ${project.ext.minecraft_version} has been published!")
81-
96+
8297
def embed = new Embed();
8398
def downloadSources = new StringJoiner('\n')
84-
85-
if (project(':Forge').hasProperty('curse_file_url')) {
86-
87-
downloadSources.add("<:forge:916233930091401266> [Forge](${project(':Forge').findProperty('curse_file_url')})")
99+
100+
if (project(':forge').hasProperty('curse_file_url')) {
101+
102+
downloadSources.add("<:forge:916233930091401266> [Forge](${project(':forge').findProperty('curse_file_url')})")
88103
}
89-
90-
if (project(':Fabric').hasProperty('curse_file_url')) {
91-
92-
downloadSources.add("<:fabric:916233929722314763> [Fabric](${project(':Fabric').findProperty('curse_file_url')})")
104+
105+
if (project(':fabric').hasProperty('curse_file_url')) {
106+
107+
downloadSources.add("<:fabric:916233929722314763> [Fabric](${project(':fabric').findProperty('curse_file_url')})")
93108
}
94-
109+
95110
// Add Curseforge DL link if available.
96111
def downloadString = downloadSources.toString()
97-
112+
98113
if (downloadString && !downloadString.isEmpty()) {
99-
114+
100115
embed.addField('Download', downloadString, false)
101116
}
102-
117+
103118
// Add a changelog field if a changelog exists.
104119
if (project.ext.mod_changelog && !project.ext.mod_changelog.isEmpty()) {
105-
120+
106121
embed.addField('Changelog', getChangelog(1500), false)
107122
}
108-
123+
109124
embed.setColor(0xFF8000)
110125
message.addEmbed(embed)
111126

112127
webhook.sendMessage(message)
113128
}
114129

115130
catch (IOException e) {
116-
131+
117132
project.logger.error('Failed to push CF Discord webhook.')
118133
}
119134
}

Common/build.gradle renamed to common/build.gradle

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
plugins {
2-
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT'
2+
id 'org.spongepowered.gradle.vanilla'
33
}
4-
54
apply from: '../gradle/property_helper.gradle'
65

7-
archivesBaseName = "${mod_name}-Common-${minecraft_version}"
6+
base {
7+
archivesName = "${mod_name}-Common-${minecraft_version}"
8+
}
89

910
minecraft {
1011
version(minecraft_version)
1112
}
1213

1314
dependencies {
14-
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5'
15+
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
16+
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
1517
}
1618

1719
processResources {
@@ -26,38 +28,26 @@ processResources {
2628

2729
// -- MAVEN PUBLISHING --
2830
project.publishing {
29-
31+
3032
publications {
3133

3234
mavenJava(MavenPublication) {
33-
34-
artifactId project.archivesBaseName
35-
36-
// Base mod archive.
37-
artifact jar
38-
39-
// Adds the sources as an artifact.
40-
artifact project.sourcesJar {
41-
classifier 'sources'
42-
}
4335

44-
// Adds the javadocs as an artifact.
45-
artifact project.javadocJar {
46-
classifier 'javadoc'
47-
}
36+
artifactId = base.archivesName.get()
37+
from components.java
4838
}
4939
}
5040

5141
repositories {
52-
42+
5343
maven {
54-
44+
5545
// Sets maven credentials if they are provided. This is generally
5646
// only used for external/remote uploads.
5747
if (project.hasProperty('mavenUsername') && project.hasProperty('mavenPassword')) {
58-
48+
5949
credentials {
60-
50+
6151
username findProperty('mavenUsername')
6252
password findProperty('mavenPassword')
6353
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)