Skip to content

Commit a60c69b

Browse files
committed
Migrate to 1.18
1 parent 1b087fc commit a60c69b

8 files changed

+203
-173
lines changed

build.gradle

+39-58
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,72 @@
11
plugins {
2-
id 'fabric-loom' version '0.6-SNAPSHOT'
3-
id 'maven-publish'
2+
id 'fabric-loom' version '0.10-SNAPSHOT'
3+
id 'maven-publish'
44
}
55

6-
sourceCompatibility = JavaVersion.VERSION_1_8
7-
targetCompatibility = JavaVersion.VERSION_1_8
6+
sourceCompatibility = JavaVersion.VERSION_17
7+
targetCompatibility = JavaVersion.VERSION_17
88

99
archivesBaseName = project.archives_base_name
1010
version = project.minecraft_version+'-'+project.mod_version // thanks carpet
1111
group = project.maven_group
1212

1313
repositories {
14-
maven {
15-
url = "https://www.cursemaven.com"
16-
}
14+
maven {
15+
url = "https://www.cursemaven.com"
16+
}
1717
}
1818

1919
dependencies {
20-
// To change the versions see the gradle.properties file
21-
minecraft "com.mojang:minecraft:${project.minecraft_version}"
22-
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
23-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
20+
// To change the versions see the gradle.properties file
21+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
22+
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
23+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
2424

25-
modImplementation "curse.maven:litematica-${project.litematica_minecraft_version}-308892:${project.litematica_fileid}"
26-
modImplementation "curse.maven:malilib-${project.litematica_minecraft_version}-303119:${project.malilib_fileid}"
25+
modImplementation "curse.maven:litematica-${project.litematica_minecraft_version}-308892:${project.litematica_fileid}"
26+
modImplementation "curse.maven:malilib-${project.litematica_minecraft_version}-303119:${project.malilib_fileid}"
2727

28-
modImplementation "net.fabricmc.fabric-api:fabric-resource-loader-v0:${project.fabric_resource_loader_version}"
29-
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
30-
// You may need to force-disable transitiveness on them.
28+
modImplementation "net.fabricmc.fabric-api:fabric-resource-loader-v0:${project.fabric_resource_loader_version}"
3129
}
3230

3331
processResources {
34-
inputs.property "version", project.version
32+
inputs.property "version", project.version
3533

36-
filesMatching("fabric.mod.json") {
37-
expand "version": project.version
38-
}
34+
filesMatching("fabric.mod.json") {
35+
expand "version": project.version
36+
}
3937
}
4038

4139
tasks.withType(JavaCompile).configureEach {
42-
// ensure that the encoding is set to UTF-8, no matter what the system default is
43-
// this fixes some edge cases with special characters not displaying correctly
44-
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
45-
// If Javadoc is generated, this must be specified in that task too.
46-
it.options.encoding = "UTF-8"
47-
48-
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
49-
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
50-
// We'll use that if it's available, but otherwise we'll use the older option.
51-
def targetVersion = 8
52-
if (JavaVersion.current().isJava9Compatible()) {
53-
it.options.release = targetVersion
54-
}
40+
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
41+
it.options.release = 17
5542
}
5643

5744
java {
58-
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
59-
// if it is present.
60-
// If you remove this line, sources will not be generated.
61-
withSourcesJar()
45+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
46+
// if it is present.
47+
// If you remove this line, sources will not be generated.
48+
withSourcesJar()
6249
}
6350

6451
jar {
65-
from("LICENSE") {
66-
rename { "${it}_${project.archivesBaseName}" }
67-
}
52+
from("LICENSE") {
53+
rename { "${it}_${project.archivesBaseName}"}
54+
}
6855
}
6956

7057
// configure the maven publication
7158
publishing {
72-
publications {
73-
mavenJava(MavenPublication) {
74-
// add all the jars that should be included when publishing to maven
75-
artifact(remapJar) {
76-
builtBy remapJar
77-
}
78-
artifact(sourcesJar) {
79-
builtBy remapSourcesJar
80-
}
81-
}
82-
}
59+
publications {
60+
mavenJava(MavenPublication) {
61+
from components.java
62+
}
63+
}
8364

84-
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
85-
repositories {
86-
// Add repositories to publish to here.
87-
// Notice: This block does NOT have the same function as the block in the top level.
88-
// The repositories here will be used for publishing your artifact, not for
89-
// retrieving dependencies.
90-
}
65+
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
66+
repositories {
67+
// Add repositories to publish to here.
68+
// Notice: This block does NOT have the same function as the block in the top level.
69+
// The repositories here will be used for publishing your artifact, not for
70+
// retrieving dependencies.
71+
}
9172
}

gradle.properties

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
org.gradle.jvmargs=-Xmx1G
33

44
# Fabric Properties
5-
# check these on https://fabricmc.net/use
6-
minecraft_version=1.16.5
7-
yarn_mappings=1.16.5+build.6
8-
loader_version=0.11.3
5+
# check these on https://fabricmc.net/versions.html
6+
minecraft_version=1.18.1
7+
yarn_mappings=1.18.1+build.1
8+
loader_version=0.12.10
99

1010
# Mod Properties
1111
mod_version = 0.3.8
1212
maven_group = ch.endte
1313
archives_base_name = syncmatica
1414

1515
# Dependencies
16-
litematica_fileid=3175258
17-
malilib_fileid=3252979
18-
litematica_minecraft_version=1.16.4
19-
fabric_resource_loader_version = 0.4.1+0d4d7e343a
16+
litematica_fileid=3545947
17+
malilib_fileid=3544210
18+
litematica_minecraft_version=1.18.0
19+
fabric_resource_loader_version = 0.4.11+3ac43d9514

gradle/wrapper/gradle-wrapper.jar

333 Bytes
Binary file not shown.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)