Skip to content

Commit bec7a16

Browse files
authored
Merge pull request #5 from tildejustin/1.16.1
upgradle, java 8
2 parents 69c56f7 + 8c8b215 commit bec7a16

11 files changed

Lines changed: 121 additions & 86 deletions

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
# gradle
2-
32
.gradle/
43
build/
54
out/
65
classes/
76

87
# eclipse
9-
108
*.launch
119

1210
# idea
13-
1411
.idea/
1512
*.iml
1613
*.ipr
1714
*.iws
1815

1916
# vscode
20-
2117
.settings/
2218
.vscode/
2319
bin/
2420
.classpath
2521
.project
2622

2723
# macos
28-
2924
*.DS_Store
3025

3126
# fabric
32-
3327
run/
28+
29+
# java
30+
hs_err_*.log
31+
replay_*.log
32+
*.hprof
33+
*.jfr

build.gradle

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,61 @@
11
plugins {
2-
id 'fabric-loom' version '1.0-SNAPSHOT'
3-
id 'org.ajoberstar.grgit' version '4.1.0'
2+
alias libs.plugins.fabric.loom
3+
id "maven-publish"
44
}
55

6-
sourceCompatibility = JavaVersion.VERSION_17
7-
targetCompatibility = JavaVersion.VERSION_17
6+
version = "$mod_version+$target_version"
7+
group = maven_group
88

9-
def getVersionMetadata() {
10-
// CI builds version numbers
11-
def build_id = System.getenv("RELEASE_TAG")
12-
if (build_id != null) {
13-
return build_id
14-
}
15-
16-
// Development builds
17-
if (grgit == null) {
18-
return "dev"
19-
}
20-
21-
// Named development builds
22-
def id = grgit.head().abbreviatedId
23-
if (!grgit.status().clean) {
24-
id += "-dirty"
25-
}
9+
base {
10+
archivesName = archives_name
11+
}
2612

27-
return "rev.${id}"
13+
repositories {
14+
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" }
15+
maven { url "https://jitpack.io" }
16+
// flatDir { dirs "libs" }
2817
}
2918

30-
archivesBaseName = "${project.mod_id}-${project.minecraft_version}"
31-
version = "${getVersionMetadata()}"
19+
loom {
20+
decompilers {
21+
vineflower {
22+
options.putAll(["mark-corresponding-synthetics": "1", "ind": " "])
23+
}
24+
}
25+
mixin {
26+
useLegacyMixinAp = false
27+
}
28+
}
3229

3330
dependencies {
34-
minecraft "com.mojang:minecraft:${project.minecraft_version}"
35-
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
36-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
31+
minecraft libs.minecraft
32+
mappings variantOf(libs.yarn.mappings) { classifier "v2" }
33+
modImplementation libs.fabric.loader
34+
vineflowerDecompilerClasspath libs.vineflower
3735
}
3836

3937
processResources {
40-
inputs.property "mod_id", project.mod_id
41-
inputs.property "version", project.version
42-
43-
filesMatching("fabric.mod.json") {
44-
expand "mod_id": project.mod_id, "version": project.version
45-
}
38+
filesMatching "fabric.mod.json", {
39+
expand "version": version
40+
}
4641
}
4742

4843
tasks.withType(JavaCompile).configureEach {
49-
it.options.release = 17
44+
it.options.encoding = "UTF-8"
45+
if (JavaVersion.current().isJava9Compatible()) it.options.release.set(8)
5046
}
5147

5248
java {
53-
withSourcesJar()
49+
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
5450
}
5551

5652
jar {
57-
from("LICENSE")
53+
from "LICENSE"
54+
}
55+
56+
publishing {
57+
publications.create("mavenJava", MavenPublication) {
58+
from components.java
59+
}
60+
repositories {}
5861
}

gradle.properties

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# Done to increase the memory available to gradle.
2-
org.gradle.jvmargs=-Xmx1G
1+
org.gradle.jvmargs = -Xmx2G
2+
org.gradle.parallel = true
3+
org.gradle.caching = true
34

4-
# Fabric Properties
5-
# check these on https://fabricmc.net/develop
6-
mod_id=setspawnmod
7-
minecraft_version=1.16.1
8-
yarn_mappings=1.16.1+build.21
9-
loader_version=0.12.2
5+
mod_version = 3.0.1
6+
target_version = 1.16.1
7+
archives_name = set-spawn
8+
maven_group = me.bdamja

gradle/libs.versions.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[versions]
2+
minecraft = "1.16.1"
3+
yarn_mappings = "1.16.1.build.19"
4+
fabric_loader = "0.15.7"
5+
loom = "1.5-SNAPSHOT"
6+
vineflower = "1.10.0-SNAPSHOT"
7+
8+
[libraries]
9+
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
10+
yarn_mappings = { module = "com.github.redlime:yarn", version.ref = "yarn_mappings" }
11+
fabric_loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric_loader" }
12+
vineflower = { module = "org.vineflower:vineflower", version.ref = "vineflower" }
13+
14+
[plugins]
15+
fabric_loom = { id = "fabric-loom", version.ref = "loom" }

gradle/wrapper/gradle-wrapper.jar

-16 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

gradlew

Lines changed: 28 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 19 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
pluginManagement {
22
repositories {
3-
maven {
4-
name = 'Fabric'
5-
url = 'https://maven.fabricmc.net/'
6-
}
3+
maven { url "https://maven.fabricmc.net" }
74
mavenCentral()
85
gradlePluginPortal()
6+
mavenLocal()
97
}
108
}

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schemaVersion": 1,
3-
"id": "${mod_id}",
3+
"id": "set-spawn",
44
"version": "${version}",
55

66
"name": "Set Spawn 1.16.1",

0 commit comments

Comments
 (0)